From 184d3b9953d5f0ca1525bf0eac61f752ef1e4f9d Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Fri, 3 Jun 2022 22:09:53 +0200 Subject: [PATCH] Add function tags --- queries/tags.scm | 11 +++++++++++ test/tags/functions.tig | 12 ++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 queries/tags.scm create mode 100644 test/tags/functions.tig 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