on master help sign in
Update Erlang highlights
cdd6c8dMichael Davis
languages.toml+1
@@ -1317,6 +1317,7 @@ scope = "source.erlang"
1317injection-regex = "erl(ang)?"
1317injection-regex = "erl(ang)?"
1318file-types = ["erl", "hrl", "app", "rebar.config", "rebar.lock"]
1318file-types = ["erl", "hrl", "app", "rebar.config", "rebar.lock"]
1319roots = ["rebar.config"]
1319roots = ["rebar.config"]
1320+shebangs = ["escript"]
1320comment-token = "%%"
1321comment-token = "%%"
1321indent = { tab-width = 4, unit = " " }
1322indent = { tab-width = 4, unit = " " }
1322language-server = { command = "erlang_ls" }
1323language-server = { command = "erlang_ls" }
runtime/queries/erlang/highlights.scm+10−10
@@ -65,6 +65,16 @@
65(function_capture module: (atom) @namespace)
65(function_capture module: (atom) @namespace)
66(function_capture function: (atom) @function)
66(function_capture function: (atom) @function)
67
67
68+; Macros
69+(macro
70+ "?"+ @constant
71+ name: (_) @constant
72+ !arguments)
73+
74+(macro
75+ "?"+ @keyword.directive
76+ name: (_) @keyword.directive)
77+
68; Ignored variables
78; Ignored variables
69((variable) @comment.discard
79((variable) @comment.discard
70 (#match? @comment.discard "^_"))
80 (#match? @comment.discard "^_"))
@@ -125,16 +135,6 @@
125(unary_operator operator: _ @operator)
135(unary_operator operator: _ @operator)
126["/" ":" "->"] @operator
136["/" ":" "->"] @operator
127
137
128−; Macros
129−(macro
130− "?"+ @constant
131− name: (_) @constant
132− !arguments)
133−
134−(macro
135− "?"+ @keyword.directive
136− name: (_) @keyword.directive)
137−
138; Comments
138; Comments
139(tripledot) @comment.discard
139(tripledot) @comment.discard
140
140