Skip to content

Commit

Permalink
Fix Lua config (#15)
Browse files Browse the repository at this point in the history
* Fix lua config

Query files are located in a subdir

* remove unused files from lua config
  • Loading branch information
leandrocp authored Apr 4, 2024
1 parent 5ac880e commit 529efce
Show file tree
Hide file tree
Showing 11 changed files with 36,398 additions and 30,752 deletions.
8 changes: 6 additions & 2 deletions build/languages.toml
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ aliases = ["gd"]
[[languages]]
name = "gleam"
repo = "https://github.com/gleam-lang/tree-sitter-gleam"
hash = "32c8f1e"
hash = "bcf9c45"

[[languages]]
name = "glsl"
Expand Down Expand Up @@ -294,8 +294,12 @@ hash = "1b96e58"
[[languages]]
name = "lua"
repo = "https://github.com/tjdevries/tree-sitter-lua"
hash = "a99b610"
hash = "acb3f36"
helix_override = true
command = '''
mv languages/temp/lua/queries/lua/*.scm languages/temp/lua/queries/ &&
rmdir languages/temp/lua/queries/lua
'''

[[languages]]
name = "make"
Expand Down
28 changes: 23 additions & 5 deletions languages/gleam/queries/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@

; Functions
(unqualified_import (identifier) @function)
(unqualified_import "type" (type_identifier) @type)
(unqualified_import (type_identifier) @constructor)
(function
name: (identifier) @function)
(external_function
Expand All @@ -43,6 +45,13 @@
(tuple_access
index: (integer) @variable.other.member)

; Attributes
(attribute
"@" @attribute
name: (identifier) @attribute)

(attribute_value (identifier) @constant)

; Type names
(remote_type_identifier) @type
(type_identifier) @type
Expand All @@ -52,18 +61,21 @@

; Literals
(string) @string
((escape_sequence) @warning
(#eq? @warning "\\e")) ; deprecated escape sequence
(escape_sequence) @constant.character.escape
(bit_string_segment_option) @function.builtin
(integer) @constant.numeric.integer
(float) @constant.numeric.float

; Reserved identifiers
((identifier) @error
(#any-of? @error "auto" "delegate" "derive" "else" "implement" "macro" "test" "echo"))

; Variables
(identifier) @variable
(discard) @comment.unused

; Operators
(binary_expression
operator: _ @operator)

; Keywords
[
(visibility_modifier) ; "pub"
Expand All @@ -72,18 +84,24 @@
"assert"
"case"
"const"
; DEPRECATED: 'external' was removed in v0.30.
"external"
"fn"
"if"
"import"
"let"
"panic"
"todo"
"try"
"type"
"use"
] @keyword

; Operators
(binary_expression
operator: _ @operator)
(boolean_negation "!" @operator)
(integer_negation "-" @operator)

; Punctuation
[
"("
Expand Down
3 changes: 3 additions & 0 deletions languages/gleam/queries/injections.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
((comment) @injection.content
(#set! injection.language "comment"))

Loading

0 comments on commit 529efce

Please sign in to comment.