diff options
| author | Clay <connorlay@users.noreply.github.com> | 2021-10-22 14:33:01 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-10-22 16:33:01 -0500 |
| commit | 97819053c86df290bf62aeafeb4a0d6a23b7c6b8 (patch) | |
| tree | f2a8c7e08055e4f9387b5e805855e8852cfaeec0 | |
| parent | Update parsers with C# fixes (#1910) (diff) | |
| download | nvim-treesitter-97819053c86df290bf62aeafeb4a0d6a23b7c6b8.tar nvim-treesitter-97819053c86df290bf62aeafeb4a0d6a23b7c6b8.tar.gz nvim-treesitter-97819053c86df290bf62aeafeb4a0d6a23b7c6b8.tar.bz2 nvim-treesitter-97819053c86df290bf62aeafeb4a0d6a23b7c6b8.tar.lz nvim-treesitter-97819053c86df290bf62aeafeb4a0d6a23b7c6b8.tar.xz nvim-treesitter-97819053c86df290bf62aeafeb4a0d6a23b7c6b8.tar.zst nvim-treesitter-97819053c86df290bf62aeafeb4a0d6a23b7c6b8.zip | |
Elixir: fix a few highlights, add ExUnit support to locals (#1933)
* Fix "not in" and sigil highlights
* Add ExUnit test case to locals
* Update README to mention new Elixir parser
| -rw-r--r-- | queries/elixir/highlights.scm | 20 | ||||
| -rw-r--r-- | queries/elixir/locals.scm | 30 |
2 files changed, 37 insertions, 13 deletions
diff --git a/queries/elixir/highlights.scm b/queries/elixir/highlights.scm index 29cb65d3a..dff497dbf 100644 --- a/queries/elixir/highlights.scm +++ b/queries/elixir/highlights.scm @@ -163,6 +163,7 @@ [ "and" "in" + "not in" "not" "or" ] @keyword.operator @@ -208,17 +209,10 @@ (unary_operator operator: "@" @comment operand: (call - target: (((identifier) @comment) @_identifier - (#any-of? @_identifier "moduledoc" "typedoc" "shortdoc" "doc")) + target: (((identifier) @comment) @_identifier) (arguments [ - (string) @comment - (charlist) @comment - (sigil - "~" @comment - (sigil_name) @comment - quoted_start: _ @comment - (quoted_content) @comment - quoted_end: _ @comment - ((sigil_modifiers) @comment)?) - (boolean) @comment - ]))) + (string) @comment + (charlist) @comment + (boolean) @comment + ])) + (#any-of? @_identifier "moduledoc" "typedoc" "shortdoc" "doc")) diff --git a/queries/elixir/locals.scm b/queries/elixir/locals.scm index b79feb3ad..79a9676df 100644 --- a/queries/elixir/locals.scm +++ b/queries/elixir/locals.scm @@ -130,5 +130,35 @@ (do_block)? ) @scope +; ExUnit Test Definitions & Scopes +(call + target: ((identifier) @_identifier (#eq? @_identifier "test")) + (arguments [ + (string) + ((string) . "," . [ + (identifier) @definition.parameter + (_ (identifier) @definition.parameter) + (_ (_ (identifier) @definition.parameter)) + (_ (_ (_ (identifier) @definition.parameter))) + (_ (_ (_ (_ (identifier) @definition.parameter)))) + (_ (_ (_ (_ (_ (identifier) @definition.parameter))))) + (_ (_ (_ (_ (_ (_ (identifier) @definition.parameter)))))) + (_ (_ (_ (_ (_ (_ (_ (identifier) @definition.parameter))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @definition.parameter)))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @definition.parameter))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @definition.parameter)))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @definition.parameter))))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @definition.parameter)))))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @definition.parameter))))))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @definition.parameter)))))))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @definition.parameter))))))))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @definition.parameter)))))))))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @definition.parameter))))))))))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @definition.parameter)))))))))))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @definition.parameter))))))))))))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @definition.parameter)))))))))))))))))))) + ]) +]) (do_block)?) @scope + ; Stab Clause Scopes (stab_clause) @scope |
