aboutsummaryrefslogtreecommitdiffstats
path: root/queries/elixir
diff options
context:
space:
mode:
authorChristian Clason <c.clason@uni-graz.at>2023-06-12 09:54:30 -0600
committerChristian Clason <c.clason@uni-graz.at>2025-05-12 18:43:40 +0200
commit692b051b09935653befdb8f7ba8afdb640adf17b (patch)
tree167162b6b129ae04f68c5735078521a72917c742 /queries/elixir
parentfeat(c-family): inherit injections (diff)
downloadnvim-treesitter-692b051b09935653befdb8f7ba8afdb640adf17b.tar
nvim-treesitter-692b051b09935653befdb8f7ba8afdb640adf17b.tar.gz
nvim-treesitter-692b051b09935653befdb8f7ba8afdb640adf17b.tar.bz2
nvim-treesitter-692b051b09935653befdb8f7ba8afdb640adf17b.tar.lz
nvim-treesitter-692b051b09935653befdb8f7ba8afdb640adf17b.tar.xz
nvim-treesitter-692b051b09935653befdb8f7ba8afdb640adf17b.tar.zst
nvim-treesitter-692b051b09935653befdb8f7ba8afdb640adf17b.zip
feat!: drop modules, general refactor and cleanup
Diffstat (limited to 'queries/elixir')
-rw-r--r--queries/elixir/folds.scm10
-rw-r--r--queries/elixir/highlights.scm217
-rw-r--r--queries/elixir/indents.scm25
-rw-r--r--queries/elixir/injections.scm59
-rw-r--r--queries/elixir/locals.scm200
5 files changed, 0 insertions, 511 deletions
diff --git a/queries/elixir/folds.scm b/queries/elixir/folds.scm
deleted file mode 100644
index 7abfe6797..000000000
--- a/queries/elixir/folds.scm
+++ /dev/null
@@ -1,10 +0,0 @@
-[
- (anonymous_function)
- (stab_clause)
- (arguments)
- (block)
- (do_block)
- (list)
- (map)
- (tuple)
-] @fold
diff --git a/queries/elixir/highlights.scm b/queries/elixir/highlights.scm
deleted file mode 100644
index cbdb40de5..000000000
--- a/queries/elixir/highlights.scm
+++ /dev/null
@@ -1,217 +0,0 @@
-; Punctuation
-[
- ","
- ";"
-] @punctuation.delimiter
-
-[
- "("
- ")"
- "<<"
- ">>"
- "["
- "]"
- "{"
- "}"
-] @punctuation.bracket
-
-"%" @punctuation.special
-
-; Identifiers
-(identifier) @variable
-
-; Unused Identifiers
-((identifier) @comment
- (#lua-match? @comment "^_"))
-
-; Comments
-(comment) @comment @spell
-
-; Strings
-(string) @string
-
-; Modules
-(alias) @module
-
-; Atoms & Keywords
-[
- (atom)
- (quoted_atom)
- (keyword)
- (quoted_keyword)
-] @string.special.symbol
-
-; Interpolation
-(interpolation
- [
- "#{"
- "}"
- ] @string.special)
-
-; Escape sequences
-(escape_sequence) @string.escape
-
-; Integers
-(integer) @number
-
-; Floats
-(float) @number.float
-
-; Characters
-[
- (char)
- (charlist)
-] @character
-
-; Booleans
-(boolean) @boolean
-
-; Nil
-(nil) @constant.builtin
-
-; Operators
-(operator_identifier) @operator
-
-(unary_operator
- operator: _ @operator)
-
-(binary_operator
- operator: _ @operator)
-
-; Pipe Operator
-(binary_operator
- operator: "|>"
- right: (identifier) @function)
-
-(dot
- operator: _ @operator)
-
-(stab_clause
- operator: _ @operator)
-
-; Local Function Calls
-(call
- target: (identifier) @function.call)
-
-; Remote Function Calls
-(call
- target: (dot
- left: [
- (atom) @type
- (_)
- ]
- right: (identifier) @function.call)
- (arguments))
-
-; Definition Function Calls
-(call
- target: ((identifier) @keyword.function
- (#any-of? @keyword.function
- "def" "defdelegate" "defexception" "defguard" "defguardp" "defimpl" "defmacro" "defmacrop"
- "defmodule" "defn" "defnp" "defoverridable" "defp" "defprotocol" "defstruct"))
- (arguments
- [
- (call
- (identifier) @function)
- (identifier) @function
- (binary_operator
- left: (call
- target: (identifier) @function)
- operator: "when")
- ])?)
-
-; Kernel Keywords & Special Forms
-(call
- target: ((identifier) @keyword
- (#any-of? @keyword
- "alias" "case" "catch" "cond" "else" "for" "if" "import" "quote" "raise" "receive" "require"
- "reraise" "super" "throw" "try" "unless" "unquote" "unquote_splicing" "use" "with")))
-
-; Special Constants
-((identifier) @constant.builtin
- (#any-of? @constant.builtin "__CALLER__" "__DIR__" "__ENV__" "__MODULE__" "__STACKTRACE__"))
-
-; Reserved Keywords
-[
- "after"
- "catch"
- "do"
- "end"
- "fn"
- "rescue"
- "when"
- "else"
-] @keyword
-
-; Operator Keywords
-[
- "and"
- "in"
- "not in"
- "not"
- "or"
-] @keyword.operator
-
-; Capture Operator
-(unary_operator
- operator: "&"
- operand: [
- (integer) @operator
- (binary_operator
- left: [
- (call
- target: (dot
- left: (_)
- right: (identifier) @function))
- (identifier) @function
- ]
- operator: "/"
- right: (integer) @operator)
- ])
-
-; Non-String Sigils
-(sigil
- "~" @string.special
- (sigil_name) @string.special @_sigil_name
- quoted_start: _ @string.special
- quoted_end: _ @string.special
- ((sigil_modifiers) @string.special)?
- (#not-any-of? @_sigil_name "s" "S"))
-
-; String Sigils
-(sigil
- "~" @string
- (sigil_name) @string @_sigil_name
- quoted_start: _ @string
- (quoted_content) @string
- quoted_end: _ @string
- ((sigil_modifiers) @string)?
- (#any-of? @_sigil_name "s" "S"))
-
-; Module attributes
-(unary_operator
- operator: "@"
- operand: [
- (identifier)
- (call
- target: (identifier))
- ] @constant) @constant
-
-; Documentation
-(unary_operator
- operator: "@"
- operand: (call
- target: ((identifier) @_identifier
- (#any-of? @_identifier "moduledoc" "typedoc" "shortdoc" "doc")) @comment.documentation
- (arguments
- [
- (string)
- (boolean)
- (charlist)
- (sigil
- "~" @comment.documentation
- (sigil_name) @comment.documentation
- quoted_start: _ @comment.documentation
- (quoted_content) @comment.documentation
- quoted_end: _ @comment.documentation)
- ] @comment.documentation))) @comment.documentation
diff --git a/queries/elixir/indents.scm b/queries/elixir/indents.scm
deleted file mode 100644
index 5470b6422..000000000
--- a/queries/elixir/indents.scm
+++ /dev/null
@@ -1,25 +0,0 @@
-[
- (block)
- (do_block)
- (list)
- (map)
- (stab_clause)
- (tuple)
- (arguments)
-] @indent.begin
-
-[
- ")"
- "]"
- "after"
- "catch"
- "else"
- "rescue"
- "}"
- "end"
-] @indent.end @indent.branch
-
-; Elixir pipelines are not indented, but other binary operator chains are
-((binary_operator
- operator: _ @_operator) @indent.begin
- (#not-eq? @_operator "|>"))
diff --git a/queries/elixir/injections.scm b/queries/elixir/injections.scm
deleted file mode 100644
index f70fd984c..000000000
--- a/queries/elixir/injections.scm
+++ /dev/null
@@ -1,59 +0,0 @@
-; Comments
-((comment) @injection.content
- (#set! injection.language "comment"))
-
-; Documentation
-(unary_operator
- operator: "@"
- operand: (call
- target: ((identifier) @_identifier
- (#any-of? @_identifier "moduledoc" "typedoc" "shortdoc" "doc"))
- (arguments
- [
- (string
- (quoted_content) @injection.content)
- (sigil
- (quoted_content) @injection.content)
- ])
- (#set! injection.language "markdown")))
-
-; HEEx
-(sigil
- (sigil_name) @_sigil_name
- (quoted_content) @injection.content
- (#any-of? @_sigil_name "H" "LVN")
- (#set! injection.language "heex"))
-
-; Surface
-(sigil
- (sigil_name) @_sigil_name
- (quoted_content) @injection.content
- (#eq? @_sigil_name "F")
- (#set! injection.language "surface"))
-
-; Zigler
-(sigil
- (sigil_name) @_sigil_name
- (quoted_content) @injection.content
- (#any-of? @_sigil_name "E" "L")
- (#set! injection.language "eex"))
-
-(sigil
- (sigil_name) @_sigil_name
- (quoted_content) @injection.content
- (#any-of? @_sigil_name "z" "Z")
- (#set! injection.language "zig"))
-
-; Regex
-(sigil
- (sigil_name) @_sigil_name
- (quoted_content) @injection.content
- (#any-of? @_sigil_name "r" "R")
- (#set! injection.language "regex"))
-
-; Json
-(sigil
- (sigil_name) @_sigil_name
- (quoted_content) @injection.content
- (#any-of? @_sigil_name "j" "J")
- (#set! injection.language "json"))
diff --git a/queries/elixir/locals.scm b/queries/elixir/locals.scm
deleted file mode 100644
index ac9d86e36..000000000
--- a/queries/elixir/locals.scm
+++ /dev/null
@@ -1,200 +0,0 @@
-; References
-(identifier) @local.reference
-
-(alias) @local.reference
-
-; Module Definitions
-(call
- target: ((identifier) @_identifier
- (#eq? @_identifier "defmodule"))
- (arguments
- (alias) @local.definition.type))
-
-; Pattern Match Definitions
-(binary_operator
- ; format-ignore
- left:
- [
- (identifier) @local.definition.var
- (_ (identifier) @local.definition.var)
- (_ (_ (identifier) @local.definition.var))
- (_ (_ (_ (identifier) @local.definition.var)))
- (_ (_ (_ (_ (identifier) @local.definition.var))))
- (_ (_ (_ (_ (_ (identifier) @local.definition.var)))))
- (_ (_ (_ (_ (_ (_ (identifier) @local.definition.var))))))
- (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.var)))))))
- (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.var))))))))
- (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.var)))))))))
- (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.var))))))))))
- (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.var)))))))))))
- (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.var))))))))))))
- (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.var)))))))))))))
- (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.var))))))))))))))
- (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.var)))))))))))))))
- (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.var))))))))))))))))
- (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.var)))))))))))))))))
- (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.var))))))))))))))))))
- (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.var)))))))))))))))))))
- (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.var))))))))))))))))))))
- ]
- operator: "=")
-
-; Stab Clause Definitions
-; format-ignore
-(stab_clause
- left:
- [
- (arguments
- [
- (identifier) @local.definition.var
- (_ (identifier) @local.definition.var)
- (_ (_ (identifier) @local.definition.var))
- (_ (_ (_ (identifier) @local.definition.var)))
- (_ (_ (_ (_ (identifier) @local.definition.var))))
- (_ (_ (_ (_ (_ (identifier) @local.definition.var)))))
- (_ (_ (_ (_ (_ (_ (identifier) @local.definition.var))))))
- (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.var)))))))
- (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.var))))))))
- (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.var)))))))))
- (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.var))))))))))
- (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.var)))))))))))
- (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.var))))))))))))
- (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.var)))))))))))))
- (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.var))))))))))))))
- (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.var)))))))))))))))
- (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.var))))))))))))))))
- (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.var)))))))))))))))))
- (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.var))))))))))))))))))
- (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.var)))))))))))))))))))
- (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.var))))))))))))))))))))
- ])
-
- (binary_operator
- left:
- (arguments
- ; format-ignore
- [
- (identifier) @local.definition.var
- (_ (identifier) @local.definition.var)
- (_ (_ (identifier) @local.definition.var))
- (_ (_ (_ (identifier) @local.definition.var)))
- (_ (_ (_ (_ (identifier) @local.definition.var))))
- (_ (_ (_ (_ (_ (identifier) @local.definition.var)))))
- (_ (_ (_ (_ (_ (_ (identifier) @local.definition.var))))))
- (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.var)))))))
- (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.var))))))))
- (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.var)))))))))
- (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.var))))))))))
- (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.var)))))))))))
- (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.var))))))))))))
- (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.var)))))))))))))
- (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.var))))))))))))))
- (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.var)))))))))))))))
- (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.var))))))))))))))))
- (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.var)))))))))))))))))
- (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.var))))))))))))))))))
- (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.var)))))))))))))))))))
- (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.var))))))))))))))))))))
- ])
- operator: "when")
- ])
-
-; Aliases
-; format-ignore
-(call
- target:
- ((identifier) @_identifier
- (#any-of? @_identifier "require" "alias" "use" "import"))
- (arguments
- [
- (alias) @local.definition.import
- (_ (alias) @local.definition.import)
- (_ (_ (alias) @local.definition.import))
- (_ (_ (_ (alias) @local.definition.import)))
- (_ (_ (_ (_ (alias) @local.definition.import))))
- ]))
-
-; Local Function Definitions & Scopes
-; format-ignore
-(call
- target:
- ((identifier) @_identifier
- (#any-of? @_identifier "def" "defp" "defmacro" "defmacrop" "defguard" "defguardp" "defn" "defnp" "for"))
- (arguments
- [
- (identifier) @local.definition.function
- (binary_operator
- left: (identifier) @local.definition.function
- operator: "when")
- (binary_operator
- (identifier) @local.definition.parameter)
- (call
- target: (identifier) @local.definition.function
- (arguments
- [
- (identifier) @local.definition.parameter
- (_ (identifier) @local.definition.parameter)
- (_ (_ (identifier) @local.definition.parameter))
- (_ (_ (_ (identifier) @local.definition.parameter)))
- (_ (_ (_ (_ (identifier) @local.definition.parameter))))
- (_ (_ (_ (_ (_ (identifier) @local.definition.parameter)))))
- (_ (_ (_ (_ (_ (_ (identifier) @local.definition.parameter))))))
- (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.parameter)))))))
- (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.parameter))))))))
- (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.parameter)))))))))
- (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.parameter))))))))))
- (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.parameter)))))))))))
- (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.parameter))))))))))))
- (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.parameter)))))))))))))
- (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.parameter))))))))))))))
- (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.parameter)))))))))))))))
- (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.parameter))))))))))))))))
- (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.parameter)))))))))))))))))
- (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.parameter))))))))))))))))))
- (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.parameter)))))))))))))))))))
- (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.parameter))))))))))))))))))))
- ]))
- ]?)
- (#set! definition.function.scope parent)(do_block)?) @local.scope
-
-; ExUnit Test Definitions & Scopes
-; format-ignore
-(call
- target:
- ((identifier) @_identifier
- (#eq? @_identifier "test"))
- (arguments
- [
- (string)
- ((string)
- .
- ","
- .
- [
- (identifier) @local.definition.parameter
- (_ (identifier) @local.definition.parameter)
- (_ (_ (identifier) @local.definition.parameter))
- (_ (_ (_ (identifier) @local.definition.parameter)))
- (_ (_ (_ (_ (identifier) @local.definition.parameter))))
- (_ (_ (_ (_ (_ (identifier) @local.definition.parameter)))))
- (_ (_ (_ (_ (_ (_ (identifier) @local.definition.parameter))))))
- (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.parameter)))))))
- (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.parameter))))))))
- (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.parameter)))))))))
- (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.parameter))))))))))
- (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.parameter)))))))))))
- (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.parameter))))))))))))
- (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.parameter)))))))))))))
- (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.parameter))))))))))))))
- (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.parameter)))))))))))))))
- (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.parameter))))))))))))))))
- (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.parameter)))))))))))))))))
- (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.parameter))))))))))))))))))
- (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.parameter)))))))))))))))))))
- (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.parameter))))))))))))))))))))
- ])
- ])
- (do_block)?) @local.scope
-
-; Stab Clause Scopes
-(stab_clause) @local.scope