mirror of
https://github.com/helix-editor/helix.git
synced 2024-11-26 03:13:29 +04:00
Update Erlang highlights
* Macros that start with underscore were incorrectly marked as 'comment.unused' rather than 'keyword.directive' due to an ordering issue of those two patterns. * Recognize escripts as Erlang by the shebang.
This commit is contained in:
parent
bb41a283e6
commit
cdd6c8d91e
@ -1317,6 +1317,7 @@ scope = "source.erlang"
|
|||||||
injection-regex = "erl(ang)?"
|
injection-regex = "erl(ang)?"
|
||||||
file-types = ["erl", "hrl", "app", "rebar.config", "rebar.lock"]
|
file-types = ["erl", "hrl", "app", "rebar.config", "rebar.lock"]
|
||||||
roots = ["rebar.config"]
|
roots = ["rebar.config"]
|
||||||
|
shebangs = ["escript"]
|
||||||
comment-token = "%%"
|
comment-token = "%%"
|
||||||
indent = { tab-width = 4, unit = " " }
|
indent = { tab-width = 4, unit = " " }
|
||||||
language-server = { command = "erlang_ls" }
|
language-server = { command = "erlang_ls" }
|
||||||
|
@ -65,6 +65,16 @@
|
|||||||
(function_capture module: (atom) @namespace)
|
(function_capture module: (atom) @namespace)
|
||||||
(function_capture function: (atom) @function)
|
(function_capture function: (atom) @function)
|
||||||
|
|
||||||
|
; Macros
|
||||||
|
(macro
|
||||||
|
"?"+ @constant
|
||||||
|
name: (_) @constant
|
||||||
|
!arguments)
|
||||||
|
|
||||||
|
(macro
|
||||||
|
"?"+ @keyword.directive
|
||||||
|
name: (_) @keyword.directive)
|
||||||
|
|
||||||
; Ignored variables
|
; Ignored variables
|
||||||
((variable) @comment.discard
|
((variable) @comment.discard
|
||||||
(#match? @comment.discard "^_"))
|
(#match? @comment.discard "^_"))
|
||||||
@ -125,16 +135,6 @@
|
|||||||
(unary_operator operator: _ @operator)
|
(unary_operator operator: _ @operator)
|
||||||
["/" ":" "->"] @operator
|
["/" ":" "->"] @operator
|
||||||
|
|
||||||
; Macros
|
|
||||||
(macro
|
|
||||||
"?"+ @constant
|
|
||||||
name: (_) @constant
|
|
||||||
!arguments)
|
|
||||||
|
|
||||||
(macro
|
|
||||||
"?"+ @keyword.directive
|
|
||||||
name: (_) @keyword.directive)
|
|
||||||
|
|
||||||
; Comments
|
; Comments
|
||||||
(tripledot) @comment.discard
|
(tripledot) @comment.discard
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user