diff options
| author | Phạm Huy Hoàng <hoangtun0810@gmail.com> | 2024-03-21 20:44:35 +0900 |
|---|---|---|
| committer | Christian Clason <c.clason@uni-graz.at> | 2024-03-21 15:51:26 +0100 |
| commit | 722617e6726c1508adadf83d531f54987c703be0 (patch) | |
| tree | 951cdcf1cd2571647a3e5afdc11d6fae5e88b630 /queries/elixir | |
| parent | feat(rust): improve indents (diff) | |
| download | nvim-treesitter-722617e6726c1508adadf83d531f54987c703be0.tar nvim-treesitter-722617e6726c1508adadf83d531f54987c703be0.tar.gz nvim-treesitter-722617e6726c1508adadf83d531f54987c703be0.tar.bz2 nvim-treesitter-722617e6726c1508adadf83d531f54987c703be0.tar.lz nvim-treesitter-722617e6726c1508adadf83d531f54987c703be0.tar.xz nvim-treesitter-722617e6726c1508adadf83d531f54987c703be0.tar.zst nvim-treesitter-722617e6726c1508adadf83d531f54987c703be0.zip | |
refactor(format): drop extra indentation for field
Diffstat (limited to 'queries/elixir')
| -rw-r--r-- | queries/elixir/highlights.scm | 109 | ||||
| -rw-r--r-- | queries/elixir/injections.scm | 24 | ||||
| -rw-r--r-- | queries/elixir/locals.scm | 5 |
3 files changed, 62 insertions, 76 deletions
diff --git a/queries/elixir/highlights.scm b/queries/elixir/highlights.scm index 43208f40f..cbdb40de5 100644 --- a/queries/elixir/highlights.scm +++ b/queries/elixir/highlights.scm @@ -95,42 +95,37 @@ ; Remote Function Calls (call - target: - (dot - left: - [ - (atom) @type - (_) - ] - right: (identifier) @function.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")) + 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) + 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"))) + 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 @@ -160,22 +155,19 @@ ; Capture Operator (unary_operator operator: "&" - operand: - [ - (integer) @operator - (binary_operator - left: - [ - (call - target: - (dot - left: (_) - right: (identifier) @function)) - (identifier) @function - ] - operator: "/" - right: (integer) @operator) - ]) + operand: [ + (integer) @operator + (binary_operator + left: [ + (call + target: (dot + left: (_) + right: (identifier) @function)) + (identifier) @function + ] + operator: "/" + right: (integer) @operator) + ]) ; Non-String Sigils (sigil @@ -199,30 +191,27 @@ ; Module attributes (unary_operator operator: "@" - operand: - [ - (identifier) - (call - target: (identifier)) - ] @constant) @constant + 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 + 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/injections.scm b/queries/elixir/injections.scm index b580f2ea6..cc74f792a 100644 --- a/queries/elixir/injections.scm +++ b/queries/elixir/injections.scm @@ -5,19 +5,17 @@ ; 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"))) + 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 diff --git a/queries/elixir/locals.scm b/queries/elixir/locals.scm index 0ce0eab74..ac9d86e36 100644 --- a/queries/elixir/locals.scm +++ b/queries/elixir/locals.scm @@ -5,9 +5,8 @@ ; Module Definitions (call - target: - ((identifier) @_identifier - (#eq? @_identifier "defmodule")) + target: ((identifier) @_identifier + (#eq? @_identifier "defmodule")) (arguments (alias) @local.definition.type)) |
