diff --git a/queries/highlights.scm b/queries/highlights.scm index be0dfd5..628eea6 100644 --- a/queries/highlights.scm +++ b/queries/highlights.scm @@ -48,6 +48,18 @@ ] @punctuation.bracket ; }}} +; Functions {{{ +(function_call + function: (identifier) @function) +(function_declaration + name: (identifier) @function) +(primitive_declaration + name: (identifier) @function) + +(parameters + name: (identifier) @variable.parameter) +; }}} + ; Misc {{{ (comment) @comment diff --git a/test/highlight/functions.tig b/test/highlight/functions.tig new file mode 100644 index 0000000..802f394 --- /dev/null +++ b/test/highlight/functions.tig @@ -0,0 +1,8 @@ +primitive print(s: string) +/* ^ function */ +/* ^ variable.parameter */ + +function func(a: int) : int = (print("Hello World!"); a) +/* ^ function */ +/* ^ variable.parameter */ +/* ^ function */ diff --git a/test/highlight/identifiers.tig b/test/highlight/identifiers.tig index eb43bf9..8a4bfef 100644 --- a/test/highlight/identifiers.tig +++ b/test/highlight/identifiers.tig @@ -22,8 +22,8 @@ var array := int_array[12] of 27; /* ^ type */ primitive func(a: int, b: string) : array -/* ^ variable */ +/* ^ variable.parameter */ /* ^ type */ -/* ^ variable */ +/* ^ variable.parameter */ /* ^ type */ /* ^ type */