mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-05 04:50:03 -04:00
feat: Add injections.scm fix: reverse order of matching Co-authored-by: 再生花 <hoangtun0810@gmail.com> fix: lua match for functions doc: Resolve conflict fix: Amend incorrect alphabetical order
81 lines
1.1 KiB
Scheme
81 lines
1.1 KiB
Scheme
; Comments
|
|
(line_comment) @comment
|
|
|
|
(block_comment) @comment
|
|
|
|
; Primitive Types
|
|
[
|
|
"bool"
|
|
"s8"
|
|
"s16"
|
|
"s32"
|
|
"s64"
|
|
"u8"
|
|
"u16"
|
|
"u32"
|
|
"u64"
|
|
"float32"
|
|
"float64"
|
|
"char"
|
|
"string"
|
|
; Container Types
|
|
"list"
|
|
"tuple"
|
|
"option"
|
|
"result"
|
|
] @type.builtin
|
|
|
|
"func" @keyword.function
|
|
|
|
; Keywords for file structure and components
|
|
[
|
|
"record"
|
|
"enum"
|
|
"variant"
|
|
"flags"
|
|
"resource"
|
|
] @keyword.type
|
|
|
|
; Keywords for importing and exporting
|
|
[
|
|
"package"
|
|
"world"
|
|
"use"
|
|
"import"
|
|
] @keyword.import
|
|
|
|
; Resource Keywords
|
|
"static" @keyword.modifier
|
|
|
|
; Named Types (Capitalized identifiers)
|
|
((identifier) @type
|
|
(#match? @type "^[A-Z]"))
|
|
|
|
((identifier) @variable
|
|
(#match? @variable "^[a-z_][a-zA-Z0-9_]*$"))
|
|
|
|
; Constants (UPPER_CASE names and Enums)
|
|
((identifier) @constant
|
|
(#match? @constant "^[A-Z][A-Z0-9_]+$"))
|
|
|
|
; Functions and Methods (lowercase names followed by parentheses)
|
|
((identifier) @function
|
|
(#match? @function "^[a-z_][a-zA-Z0-9_]*%("))
|
|
|
|
; Punctuation
|
|
[
|
|
";"
|
|
":"
|
|
"->"
|
|
] @punctuation.special
|
|
|
|
; Delimiters
|
|
"," @punctuation.delimiter
|
|
|
|
; Brackets
|
|
[
|
|
"{"
|
|
"}"
|
|
"("
|
|
")"
|
|
] @punctuation.bracket
|