diff --git a/queries/highlights.scm b/queries/highlights.scm index cdf93a7..cda9f5d 100644 --- a/queries/highlights.scm +++ b/queries/highlights.scm @@ -1,5 +1,9 @@ ; Misc {{{ (comment) @comment + +(type_identifier) @type +(field_identifier) @property +(identifier) @variable ; }}} ; Keywords {{{ diff --git a/test/highlight/identifiers.tig b/test/highlight/identifiers.tig new file mode 100644 index 0000000..eb43bf9 --- /dev/null +++ b/test/highlight/identifiers.tig @@ -0,0 +1,29 @@ +type int = int +/* ^ variable */ +/* ^ type */ + +type int_array = array of int +/* ^ type */ + +type record = {a: int, b: string} +/* ^ property */ +/* ^ type */ +/* ^ property */ +/* ^ type */ + +var record := record {a = 12, b = "27"} +/* ^ variable */ +/* ^ type */ +/* ^ property */ +/* ^ property */ + +var array := int_array[12] of 27; +/* ^ variable */ +/* ^ type */ + +primitive func(a: int, b: string) : array +/* ^ variable */ +/* ^ type */ +/* ^ variable */ +/* ^ type */ +/* ^ type */