From 64ff9dd944cd19486a0bdfa485f2ac5cdeaa456c Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Fri, 3 Jun 2022 20:32:06 +0200 Subject: [PATCH] Add import path high-lighting I don't think this group is supported by neovim, but 'tree-sitter-nix' makes use of it, and I think it makes sense to add it. --- queries/highlights.scm | 5 +++++ test/highlight/imports.tig | 3 +++ 2 files changed, 8 insertions(+) create mode 100644 test/highlight/imports.tig diff --git a/queries/highlights.scm b/queries/highlights.scm index 25f10db..e9e8536 100644 --- a/queries/highlights.scm +++ b/queries/highlights.scm @@ -65,6 +65,11 @@ name: (identifier) @variable.parameter) ; }}} +; Declarations {{{ +(import_declaration + file: (string_literal) @string.special.path) +; }}} + ; Literals {{{ (nil_literal) @constant.builtin (integer_literal) @number diff --git a/test/highlight/imports.tig b/test/highlight/imports.tig new file mode 100644 index 0000000..c056c30 --- /dev/null +++ b/test/highlight/imports.tig @@ -0,0 +1,3 @@ +import "lib.tih" +/* <- keyword */ +/* ^ string.special.path */