diff --git a/queries/tags.scm b/queries/tags.scm new file mode 100644 index 0000000..89c521d --- /dev/null +++ b/queries/tags.scm @@ -0,0 +1,11 @@ +; Functions {{{ +(function_declaration + name: (identifier) @name) @definition.function +(primitive_declaration + name: (identifier) @name) @definition.function + +(function_call + function: (identifier) @name) @reference.call +; }}} + +; vim: sw=2 foldmethod=marker diff --git a/test/tags/functions.tig b/test/tags/functions.tig new file mode 100644 index 0000000..d6931e0 --- /dev/null +++ b/test/tags/functions.tig @@ -0,0 +1,12 @@ +let + primitive print(s: string) + /* ^ definition.function */ + + function func(a: int) : int = (print("Hello World!"); a) + /* ^ definition.function */ +in + print("Hello World!\n"); + /* <- reference.call */ + func(42) + /* <- reference.call */ +end