From 23a739c0ac7b0da6611fff7b886c1c74fcda5c92 Mon Sep 17 00:00:00 2001 From: Steven Arcangeli Date: Tue, 31 Oct 2023 16:49:22 -0700 Subject: [PATCH] refactor: rename @type capture to @symbol --- lua/aerial/backends/treesitter/extensions.lua | 13 +++++++--- lua/aerial/backends/treesitter/init.lua | 18 ++++++------- queries/bash/aerial.scm | 2 +- queries/c/aerial.scm | 8 +++--- queries/c_sharp/aerial.scm | 16 ++++++------ queries/cpp/aerial.scm | 10 +++---- queries/dart/aerial.scm | 10 +++---- queries/elixir/aerial.scm | 20 +++++++------- queries/go/aerial.scm | 8 +++--- queries/help/aerial.scm | 6 ++--- queries/html/aerial.scm | 6 ++--- queries/java/aerial.scm | 12 ++++----- queries/javascript/aerial.scm | 18 ++++++------- queries/json/aerial.scm | 2 +- queries/julia/aerial.scm | 18 ++++++------- queries/latex/aerial.scm | 14 +++++----- queries/lua/aerial.scm | 12 ++++----- queries/make/aerial.scm | 2 +- queries/markdown/aerial.scm | 4 +-- queries/norg/aerial.scm | 12 ++++----- queries/objdump/aerial.scm | 4 +-- queries/org/aerial.scm | 2 +- queries/php/aerial.scm | 12 ++++----- queries/proto/aerial.scm | 4 +-- queries/python/aerial.scm | 6 ++--- queries/rst/aerial.scm | 2 +- queries/ruby/aerial.scm | 16 ++++++------ queries/rust/aerial.scm | 16 ++++++------ queries/scala/aerial.scm | 10 +++---- queries/snakemake/aerial.scm | 8 +++--- queries/solidity/aerial.scm | 26 +++++++++---------- queries/teal/aerial.scm | 8 +++--- queries/tsx/aerial.scm | 24 ++++++++--------- queries/typescript/aerial.scm | 24 ++++++++--------- queries/usd/aerial.scm | 14 +++++----- queries/vim/aerial.scm | 2 +- queries/vimdoc/aerial.scm | 6 ++--- queries/yaml/aerial.scm | 4 +-- 38 files changed, 202 insertions(+), 197 deletions(-) diff --git a/lua/aerial/backends/treesitter/extensions.lua b/lua/aerial/backends/treesitter/extensions.lua index 45d5c47..c45ca81 100644 --- a/lua/aerial/backends/treesitter/extensions.lua +++ b/lua/aerial/backends/treesitter/extensions.lua @@ -6,7 +6,12 @@ local M = {} ---@param path string ---@return nil|TSNode local function node_from_match(match, path) - return ((match or {})[path] or {}).node + local ret = ((match or {})[path] or {}).node + if path == "symbol" and not ret then + -- Backwards compatibility for old @type capture + ret = ((match or {}).type or {}).node + end + return ret end local get_node_text = vim.treesitter.get_node_text @@ -164,7 +169,7 @@ M.help = { -- We need to get _all_ word nodes local pieces = {} local node = match.name.node - if vim.startswith(match.type.node:type(), "h") then + if vim.startswith(node_from_match(match, "symbol"):type(), "h") then while node and node:type() == "word" do local row, col = node:start() table.insert(pieces, 1, get_node_text(node, bufnr)) @@ -303,7 +308,7 @@ M.cpp = { if item.kind ~= "Function" then return end - local parent = node_from_match(match, "type") + local parent = node_from_match(match, "symbol") local stop_types = { "function_definition", "declaration", "field_declaration" } while parent and not vim.tbl_contains(stop_types, parent:type()) do parent = parent:parent() @@ -349,7 +354,7 @@ M.typescript = { M.latex = { postprocess = function(bufnr, item, match) - local type_node = assert(node_from_match(match, "type")) + local type_node = assert(node_from_match(match, "symbol")) local base_type = type_node:type() if base_type == "title_declaration" then item.name = "Title: " .. item.name diff --git a/lua/aerial/backends/treesitter/init.lua b/lua/aerial/backends/treesitter/init.lua index 948fabf..eee6713 100644 --- a/lua/aerial/backends/treesitter/init.lua +++ b/lua/aerial/backends/treesitter/init.lua @@ -6,9 +6,9 @@ local util = require("aerial.backends.util") local M = {} -- Custom capture groups: --- type: Used to determine the SymbolKind (via language_kind_map) +-- symbol: Used to determine to unique node that represents the symbol -- name (optional): The text of this node will be used in the display --- start (optional): The location of the start of this symbol (default @type) +-- start (optional): The location of the start of this symbol (default @symbol) -- end (optional): The location of the end of this symbol (default @start) M.is_supported = function(bufnr) @@ -81,15 +81,15 @@ M.fetch_symbols_sync = function(bufnr) local name_match = match.name or {} local selection_match = match.selection or {} - local type_node = (match.type or {}).node + local symbol_node = (match.symbol or match.type or {}).node -- The location capture groups are optional. We default to the - -- location of the @type capture - local start_node = (match.start or {}).node or type_node + -- location of the @symbol capture + local start_node = (match.start or {}).node or symbol_node local end_node = (match["end"] or {}).node or start_node - local parent_item, parent_node, level = ext.get_parent(stack, match, type_node) + local parent_item, parent_node, level = ext.get_parent(stack, match, symbol_node) -- Sometimes our queries will match the same node twice. - -- Detect that (type_node == parent_node), and skip dupes. - if not type_node or type_node == parent_node then + -- Detect that (symbol_node == parent_node), and skip dupes. + if not symbol_node or symbol_node == parent_node then goto continue end local kind = match.kind @@ -152,7 +152,7 @@ M.fetch_symbols_sync = function(bufnr) else table.insert(items, item) end - table.insert(stack, { node = type_node, item = item }) + table.insert(stack, { node = symbol_node, item = item }) ::continue:: end diff --git a/queries/bash/aerial.scm b/queries/bash/aerial.scm index 8516235..b4d4b71 100644 --- a/queries/bash/aerial.scm +++ b/queries/bash/aerial.scm @@ -1,4 +1,4 @@ (function_definition name: (word) @name (#set! "kind" "Function") - ) @type + ) @symbol diff --git a/queries/c/aerial.scm b/queries/c/aerial.scm index f6dbdbd..84b481d 100644 --- a/queries/c/aerial.scm +++ b/queries/c/aerial.scm @@ -1,11 +1,11 @@ (type_definition - type: (enum_specifier) @type + type: (enum_specifier) @symbol declarator: (type_identifier) @name (#set! "kind" "Enum") ) @start (type_definition - type: (struct_specifier) @type + type: (struct_specifier) @symbol declarator: (type_identifier) @name (#set! "kind" "Struct") ) @start @@ -13,10 +13,10 @@ ( (declaration) @root @start . - (function_definition) @type @end + (function_definition) @symbol @end (#set! "kind" "Function") ) (function_definition (#set! "kind" "Function") - ) @type @root + ) @symbol @root diff --git a/queries/c_sharp/aerial.scm b/queries/c_sharp/aerial.scm index 48da546..f775eef 100644 --- a/queries/c_sharp/aerial.scm +++ b/queries/c_sharp/aerial.scm @@ -1,41 +1,41 @@ (interface_declaration name: (identifier) @name (#set! "kind" "Interface") - ) @type + ) @symbol (class_declaration name: (identifier) @name (#set! "kind" "Class") - ) @type + ) @symbol (struct_declaration name: (identifier) @name (#set! "kind" "Struct") - ) @type + ) @symbol (method_declaration name: (identifier) @name (#set! "kind" "Method") - ) @type + ) @symbol (enum_declaration name: (identifier) @name (#set! "kind" "Enum") - ) @type + ) @symbol (constructor_declaration name: (identifier) @name (#set! "kind" "Constructor") - ) @type + ) @symbol (property_declaration name: (identifier) @name (#set! "kind" "Property") - ) @type + ) @symbol (field_declaration (variable_declaration (variable_declarator (identifier) @name)) (#set! "kind" "Field") - ) @type + ) @symbol diff --git a/queries/cpp/aerial.scm b/queries/cpp/aerial.scm index 0b27c86..ca29b6c 100644 --- a/queries/cpp/aerial.scm +++ b/queries/cpp/aerial.scm @@ -2,12 +2,12 @@ name: (type_identifier) @name body: (field_declaration_list) (#set! "kind" "Struct") -) @type +) @symbol (declaration (struct_specifier body: (field_declaration_list) - ) @type + ) @symbol declarator: (identifier) @name (#set! "kind" "Struct") ) @@ -15,14 +15,14 @@ (function_declarator declarator: (_) @name (#set! "kind" "Function") - ) @type + ) @symbol (enum_specifier name: (type_identifier) @name (#set! "kind" "Enum") - ) @type + ) @symbol (class_specifier name: (type_identifier) @name (#set! "kind" "Class") - ) @type + ) @symbol diff --git a/queries/dart/aerial.scm b/queries/dart/aerial.scm index 11e5afb..1d6c670 100644 --- a/queries/dart/aerial.scm +++ b/queries/dart/aerial.scm @@ -1,12 +1,12 @@ (class_definition name: (identifier) @name (#set! "kind" "Class") - ) @type + ) @symbol (constructor_signature name: (identifier) @name (#set! "kind" "Constructor") - ) @type + ) @symbol ( (method_signature @@ -17,7 +17,7 @@ (setter_signature name: (identifier) @name) ] - ) @type + ) @symbol . (function_body) @end (#set! "kind" "Method") @@ -25,7 +25,7 @@ ( (function_signature - name: (identifier) @name) @type + name: (identifier) @name) @symbol . (function_body) @end (#set! "kind" "Function") @@ -34,4 +34,4 @@ (enum_declaration name: (identifier) @name (#set! "kind" "Enum") - ) @type + ) @symbol diff --git a/queries/elixir/aerial.scm b/queries/elixir/aerial.scm index 1ff9368..d711eef 100644 --- a/queries/elixir/aerial.scm +++ b/queries/elixir/aerial.scm @@ -2,7 +2,7 @@ target: (identifier) @identifier (#any-of? @identifier "defmodule" "defprotocol") (arguments) @name (#set! "kind" "Function") - ) @type + ) @symbol (call target: (identifier) @identifier (#eq? @identifier "defimpl") @@ -13,7 +13,7 @@ value: (alias) @name)) ) (#set! "kind" "Function") - ) @type + ) @symbol (call target: (identifier) @identifier (#any-of? @identifier "def" "defp" "defguard" "defmacro" "defmacrop") @@ -23,7 +23,7 @@ ((identifier) @name) ]) (#set! "kind" "Function") - ) @type + ) @symbol (unary_operator operator: "@" @@ -33,7 +33,7 @@ (call target: (identifier) @name) (binary_operator left: (call target: (identifier) @name)) ])) - @type + @symbol (#set! "kind" "Function") ) @start @@ -42,20 +42,20 @@ operand: (call target: (identifier) @identifier (#eq? @identifier "module_attribute") (arguments) @name - ) @type + ) @symbol (#set! "kind" "Function") ) @start (unary_operator operator: "@" - operand: (call target: (identifier) @name (#not-any-of? @name "module_attribute" "callback" "spec" "doc" "moduledoc")) @type + operand: (call target: (identifier) @name (#not-any-of? @name "module_attribute" "callback" "spec" "doc" "moduledoc")) @symbol (#set! "kind" "Constant") ) @start (do_block (call - target: (identifier) @identifier (#eq? @identifier "defstruct")) @type + target: (identifier) @identifier (#eq? @identifier "defstruct")) @symbol (#set! "kind" "Function") ) @start @@ -64,12 +64,12 @@ target: (identifier) @identifier (#any-of? @identifier "describe" "test") (arguments [(string (quoted_content) @name)]) (#set! "kind" "Function") - ) @type + ) @symbol ; exunit test setup (do_block (call - target: (identifier) @identifier @name (#eq? @identifier "setup")) @type + target: (identifier) @identifier @name (#eq? @identifier "setup")) @symbol (#set! "kind" "Function") - ) @type + ) @symbol diff --git a/queries/go/aerial.scm b/queries/go/aerial.scm index 3f71ab2..00ad8ea 100644 --- a/queries/go/aerial.scm +++ b/queries/go/aerial.scm @@ -1,19 +1,19 @@ (function_declaration name: (identifier) @name (#set! "kind" "Function") - ) @type + ) @symbol (type_declaration (type_spec name: (type_identifier) @name - type: (struct_type) @type) + type: (struct_type) @symbol) (#set! "kind" "Struct") ) @start (type_declaration (type_spec name: (type_identifier) @name - type: (interface_type) @type) + type: (interface_type) @symbol) (#set! "kind" "Interface") ) @start @@ -21,4 +21,4 @@ receiver: (_) @receiver name: (field_identifier) @name (#set! "kind" "Method") - ) @type + ) @symbol diff --git a/queries/help/aerial.scm b/queries/help/aerial.scm index 46e0752..bc13123 100644 --- a/queries/help/aerial.scm +++ b/queries/help/aerial.scm @@ -4,15 +4,15 @@ (word)+ @name @start (tag) (#set! "kind" "Interface") -) @type +) @symbol (h2 (word)+ @name @start (tag) (#set! "kind" "Interface") -) @type +) @symbol (tag text: (word) @name (#set! "kind" "Interface") -) @type +) @symbol diff --git a/queries/html/aerial.scm b/queries/html/aerial.scm index 5af5ef8..b62529b 100644 --- a/queries/html/aerial.scm +++ b/queries/html/aerial.scm @@ -1,6 +1,6 @@ ((doctype) @name (#set! "kind" "Module") -) @type +) @symbol (_ [ @@ -8,8 +8,8 @@ (self_closing_tag (tag_name) @name) ] (#set! "kind" "Struct") -) @type +) @symbol (attribute (attribute_name) @name (#set! "kind" "Field") -) @type +) @symbol diff --git a/queries/java/aerial.scm b/queries/java/aerial.scm index 73c791c..5d05c9f 100644 --- a/queries/java/aerial.scm +++ b/queries/java/aerial.scm @@ -1,30 +1,30 @@ (interface_declaration name: (identifier) @name (#set! "kind" "Interface") - ) @type + ) @symbol (method_declaration name: (identifier) @name (#set! "kind" "Method") - ) @type + ) @symbol (constructor_declaration name: (identifier) @name (#set! "kind" "Constructor") - ) @type + ) @symbol (class_declaration name: (identifier) @name (#set! "kind" "Class") - ) @type + ) @symbol (enum_declaration name: (identifier) @name (#set! "kind" "Enum") - ) @type + ) @symbol (field_declaration declarator: (variable_declarator name: (identifier) @name) (#set! "kind" "Field") - ) @type + ) @symbol diff --git a/queries/javascript/aerial.scm b/queries/javascript/aerial.scm index bb249cc..a8e2c00 100644 --- a/queries/javascript/aerial.scm +++ b/queries/javascript/aerial.scm @@ -1,34 +1,34 @@ (class_declaration name: (identifier) @name (#set! "kind" "Class") - ) @type + ) @symbol (function_declaration name: (identifier) @name (#set! "kind" "Function") - ) @type + ) @symbol (generator_function_declaration name: (identifier) @name (#set! "kind" "Function") - ) @type + ) @symbol (method_definition name: (property_identifier) @name (#set! "kind" "Method") - ) @type + ) @symbol (field_definition property: (property_identifier) @name value: (arrow_function) (#set! "kind" "Method") - ) @type + ) @symbol ; const fn = () => {} (lexical_declaration (variable_declarator name: (identifier) @name - value: [(arrow_function) (function) (generator_function)] @type + value: [(arrow_function) (function) (generator_function)] @symbol ) (#set! "kind" "Function") ) @start @@ -40,7 +40,7 @@ (string (string_fragment) @name @string))? (#set! "kind" "Function") - ) @type + ) @symbol ; test.skip("this test") (call_expression @@ -52,7 +52,7 @@ (string (string_fragment) @name @string))? (#set! "kind" "Function") - ) @type + ) @symbol ; describe.each([])("Test suite") (call_expression @@ -66,4 +66,4 @@ (string (string_fragment) @name @string))? (#set! "kind" "Function") - ) @type + ) @symbol diff --git a/queries/json/aerial.scm b/queries/json/aerial.scm index eb0c4b1..ab7f3bb 100644 --- a/queries/json/aerial.scm +++ b/queries/json/aerial.scm @@ -1,6 +1,6 @@ (pair key: (string (string_content) @name) - value: (object) @type + value: (object) @symbol (#set! "kind" "Class") ) @start diff --git a/queries/julia/aerial.scm b/queries/julia/aerial.scm index 1823abe..a98c9a4 100644 --- a/queries/julia/aerial.scm +++ b/queries/julia/aerial.scm @@ -1,49 +1,49 @@ (module_definition name: (identifier) @name (#set! "kind" "Module") - ) @type + ) @symbol (function_definition name: (identifier) @name (#set! "kind" "Function") - ) @type + ) @symbol (function_definition name: (field_expression value: (_) (identifier)) @name (#set! "kind" "Function") - ) @type + ) @symbol (short_function_definition name: (identifier) @name (#set! "kind" "Function") - ) @type + ) @symbol (short_function_definition name: (field_expression value: (_) (identifier)) @name (#set! "kind" "Function") - ) @type + ) @symbol (abstract_definition name: (identifier) @name (#set! "kind" "Interface") - ) @type + ) @symbol (struct_definition name: (identifier) @name (#set! "kind" "Class") - ) @type + ) @symbol (const_statement (assignment . (identifier) @name) (#set! "kind" "Constant") - ) @type + ) @symbol (macro_definition name: (identifier) @name (#set! "kind" "Function") - ) @type + ) @symbol diff --git a/queries/latex/aerial.scm b/queries/latex/aerial.scm index 63e9e0f..2dac198 100644 --- a/queries/latex/aerial.scm +++ b/queries/latex/aerial.scm @@ -1,32 +1,32 @@ (section text: [(curly_group (text) @name) (_)] @name (#set! "kind" "Method") -) @type +) @symbol (subsection text: [(curly_group (text) @name) (_)] @name (#set! "kind" "Method") -) @type +) @symbol (subsubsection text: [(curly_group (text) @name) (_)] @name (#set! "kind" "Method") -) @type +) @symbol (generic_environment begin: (begin name: [(curly_group_text text: (text) @name) (_)] @name ) (#set! "kind" "Class") - ) @type + ) @symbol (new_command_definition declaration: [(curly_group_command_name command: (command_name) @name) (_)] @name (#set! "kind" "Operator") -) @type +) @symbol (title_declaration text: [(curly_group (text) @name) (_)] @name (#set! "kind" "Field") -) @type +) @symbol (author_declaration authors: [(curly_group_author_list (author) @name) (_)] @name (#set! "kind" "Field") -) @type +) @symbol diff --git a/queries/lua/aerial.scm b/queries/lua/aerial.scm index 5be246a..ccf76df 100644 --- a/queries/lua/aerial.scm +++ b/queries/lua/aerial.scm @@ -1,14 +1,14 @@ (function_declaration name: [(identifier) (dot_index_expression) (method_index_expression)] @name (#set! "kind" "Function") - ) @type + ) @symbol (variable_declaration (assignment_statement (variable_list name: [(identifier) (dot_index_expression)] @name) (expression_list - value: (function_definition) @type)) + value: (function_definition) @symbol)) (#set! "kind" "Function") ) @start @@ -16,13 +16,13 @@ (variable_list name: [(identifier) (dot_index_expression) (bracket_index_expression)] @name) (expression_list - value: (function_definition) @type) + value: (function_definition) @symbol) (#set! "kind" "Function") ) @start (field name: (identifier) @name - value: (function_definition) @type + value: (function_definition) @symbol (#set! "kind" "Function") ) @start @@ -30,7 +30,7 @@ name: (identifier) @method @name (#any-of? @method "describe" "it" "before_each" "after_each" "setup" "teardown") arguments: (arguments (string)? @name - (function_definition) @type) + (function_definition) @symbol) (#set! "kind" "Function") ) @start @selection @@ -41,6 +41,6 @@ ) arguments: (arguments (string)? @name - (function_definition) @type) + (function_definition) @symbol) (#set! "kind" "Function") ) @start @selection diff --git a/queries/make/aerial.scm b/queries/make/aerial.scm index 1619470..c0d2fe2 100644 --- a/queries/make/aerial.scm +++ b/queries/make/aerial.scm @@ -1,4 +1,4 @@ (rule (targets) @name (#set! "kind" "Interface") - ) @type + ) @symbol diff --git a/queries/markdown/aerial.scm b/queries/markdown/aerial.scm index c3e45c5..2bcde37 100644 --- a/queries/markdown/aerial.scm +++ b/queries/markdown/aerial.scm @@ -2,10 +2,10 @@ [(atx_h1_marker) (atx_h2_marker) (atx_h3_marker) (atx_h4_marker) (atx_h5_marker) (atx_h6_marker)] @level heading_content: (_) @name (#set! "kind" "Interface") - ) @type + ) @symbol (setext_heading heading_content: (_) @name (#set! "kind" "Interface") [(setext_h1_underline) (setext_h2_underline)] @level - ) @type + ) @symbol diff --git a/queries/norg/aerial.scm b/queries/norg/aerial.scm index ea3580f..8ea39ea 100644 --- a/queries/norg/aerial.scm +++ b/queries/norg/aerial.scm @@ -1,36 +1,36 @@ ;; Headings ((heading1 (heading1_prefix) - title: (paragraph_segment) @name) @type + title: (paragraph_segment) @name) @symbol (#set! "kind" "Interface") ) ((heading2 (heading2_prefix) - title: (paragraph_segment) @name) @type + title: (paragraph_segment) @name) @symbol (#set! "kind" "Interface") ) ((heading3 (heading3_prefix) - title: (paragraph_segment) @name) @type + title: (paragraph_segment) @name) @symbol (#set! "kind" "Interface") ) ((heading4 (heading4_prefix) - title: (paragraph_segment) @name) @type + title: (paragraph_segment) @name) @symbol (#set! "kind" "Interface") ) ((heading5 (heading5_prefix) - title: (paragraph_segment) @name) @type + title: (paragraph_segment) @name) @symbol (#set! "kind" "Interface") ) ((heading6 (heading6_prefix) - title: (paragraph_segment) @name) @type + title: (paragraph_segment) @name) @symbol (#set! "kind" "Interface") ) diff --git a/queries/objdump/aerial.scm b/queries/objdump/aerial.scm index 385851b..ac18772 100644 --- a/queries/objdump/aerial.scm +++ b/queries/objdump/aerial.scm @@ -1,7 +1,7 @@ (disassembly_section_label (identifier) @name - (#set! "kind" "Interface")) @type + (#set! "kind" "Interface")) @symbol (disassembly_section (identifier) @name - (#set! "kind" "Function")) @type + (#set! "kind" "Function")) @symbol diff --git a/queries/org/aerial.scm b/queries/org/aerial.scm index 8ebe8d2..5de9d8f 100644 --- a/queries/org/aerial.scm +++ b/queries/org/aerial.scm @@ -2,4 +2,4 @@ (headline item: (item) @name) (#set! "kind" "Interface") - ) @type + ) @symbol diff --git a/queries/php/aerial.scm b/queries/php/aerial.scm index 360a5e7..e28f39b 100644 --- a/queries/php/aerial.scm +++ b/queries/php/aerial.scm @@ -1,12 +1,12 @@ (function_definition name: (name) @name (#set! "kind" "Function") - ) @type + ) @symbol (expression_statement (assignment_expression left: (variable_name) @name - right: (anonymous_function_creation_expression) @type + right: (anonymous_function_creation_expression) @symbol ) (#set! "kind" "Function") ) @start @@ -14,19 +14,19 @@ (class_declaration name: (name) @name (#set! "kind" "Class") - ) @type + ) @symbol (method_declaration name: (name) @name (#set! "kind" "Method") - ) @type + ) @symbol (interface_declaration name: (name) @name (#set! "kind" "Interface") - ) @type + ) @symbol (trait_declaration name: (name) @name (#set! "kind" "Class") - ) @type + ) @symbol diff --git a/queries/proto/aerial.scm b/queries/proto/aerial.scm index 8e278a6..ee5dfae 100644 --- a/queries/proto/aerial.scm +++ b/queries/proto/aerial.scm @@ -1,9 +1,9 @@ (message (message_name) @name (#set! "kind" "Class") -) @type +) @symbol (enum (enum_name) @name (#set! "kind" "Enum") -) @type +) @symbol diff --git a/queries/python/aerial.scm b/queries/python/aerial.scm index f235005..7cf91f9 100644 --- a/queries/python/aerial.scm +++ b/queries/python/aerial.scm @@ -1,14 +1,14 @@ (function_definition name: (identifier) @name (#set! "kind" "Function") - ) @type + ) @symbol (class_definition name: (identifier) @name (#set! "kind" "Class") - ) @type + ) @symbol (assignment left: (_) @name (#set! "kind" "Variable") - ) @type + ) @symbol diff --git a/queries/rst/aerial.scm b/queries/rst/aerial.scm index baf93a4..cce0e11 100644 --- a/queries/rst/aerial.scm +++ b/queries/rst/aerial.scm @@ -1,4 +1,4 @@ (section (title) @name (#set! "kind" "Interface") - ) @type + ) @symbol diff --git a/queries/ruby/aerial.scm b/queries/ruby/aerial.scm index 0a93c3c..da09f20 100644 --- a/queries/ruby/aerial.scm +++ b/queries/ruby/aerial.scm @@ -1,12 +1,12 @@ (class name: [(constant) (scope_resolution)] @name (#set! "kind" "Class") - ) @type + ) @symbol (method name: (_) @name (#set! "kind" "Method") - ) @type + ) @symbol (call (identifier) @scope_switch @@ -17,7 +17,7 @@ name: (_) @name (#set! "kind" "Method") (#set! "scope" "private") - ) @type + ) @symbol ) ) @@ -34,7 +34,7 @@ name: (_) @name (#set! "kind" "Method") (#set! "scope" "private") - ) @type + ) @symbol ) (singleton_method @@ -42,17 +42,17 @@ (["." "::"] @separator)? name: [(operator) (identifier)] @name (#set! "kind" "Method") - ) @type + ) @symbol (singleton_class value: (_) @name (#set! "kind" "Class") - ) @type + ) @symbol (module name: [(constant) (scope_resolution)] @name (#set! "kind" "Module") - ) @type + ) @symbol ; For Rspec, Rake, and Shoulda (call @@ -70,4 +70,4 @@ (call) @name ])? (#set! "kind" "Method") -) @type @selection +) @symbol @selection diff --git a/queries/rust/aerial.scm b/queries/rust/aerial.scm index 9ade234..1c8a684 100644 --- a/queries/rust/aerial.scm +++ b/queries/rust/aerial.scm @@ -1,42 +1,42 @@ (mod_item name: (identifier) @name (#set! "kind" "Module") - ) @type + ) @symbol (enum_item name: (type_identifier) @name (#set! "kind" "Enum") - ) @type + ) @symbol (struct_item name: (type_identifier) @name (#set! "kind" "Struct") - ) @type + ) @symbol (function_item name: (identifier) @name (#set! "kind" "Function") - ) @type + ) @symbol (function_signature_item name: (identifier) @name (#set! "kind" "Function") - ) @type + ) @symbol (trait_item name: (type_identifier) @name (#set! "kind" "Interface") - ) @type + ) @symbol (impl_item trait: (type_identifier)? @trait type: (type_identifier) @rust_type (#set! "kind" "Class") - ) @type + ) @symbol (impl_item trait: (type_identifier)? @trait type: (generic_type type: (type_identifier) @rust_type) (#set! "kind" "Class") - ) @type + ) @symbol diff --git a/queries/scala/aerial.scm b/queries/scala/aerial.scm index c0206a8..a819148 100644 --- a/queries/scala/aerial.scm +++ b/queries/scala/aerial.scm @@ -1,24 +1,24 @@ (trait_definition name: (identifier) @name (#set! "kind" "Interface") - ) @type + ) @symbol (object_definition name: (identifier) @name (#set! "kind" "Class") - ) @type + ) @symbol (class_definition name: (identifier) @name (#set! "kind" "Class") - ) @type + ) @symbol (function_declaration name: (identifier) @name (#set! "kind" "Function") - ) @type + ) @symbol (function_definition name: (identifier) @name (#set! "kind" "Function") - ) @type + ) @symbol diff --git a/queries/snakemake/aerial.scm b/queries/snakemake/aerial.scm index 969949f..b8c4ff5 100644 --- a/queries/snakemake/aerial.scm +++ b/queries/snakemake/aerial.scm @@ -1,19 +1,19 @@ (function_definition name: (identifier) @name (#set! "kind" "Function") - ) @type + ) @symbol (class_definition name: (identifier) @name (#set! "kind" "Class") - ) @type + ) @symbol (assignment left: (_) @name (#set! "kind" "Variable") - ) @type + ) @symbol (rule_definition name: (identifier) @name (#set! "kind" "Class") -) @type +) @symbol diff --git a/queries/solidity/aerial.scm b/queries/solidity/aerial.scm index c014ba0..dc6a1d7 100644 --- a/queries/solidity/aerial.scm +++ b/queries/solidity/aerial.scm @@ -1,68 +1,68 @@ (contract_declaration name: (identifier) @name (#set! "kind" "Class") - ) @type + ) @symbol (contract_declaration (_ (function_definition name: (identifier) @name (#set! "kind" "Method") - ) @type)) + ) @symbol)) (contract_declaration (_ (modifier_definition name: (identifier) @name (#set! "kind" "Method") - ) @type)) + ) @symbol)) (library_declaration (_ (function_definition name: (identifier) @name (#set! "kind" "Function") - ) @type)) + ) @symbol)) (interface_declaration name: (identifier) @name (#set! "kind" "Interface") - ) @type + ) @symbol (interface_declaration (_ (function_definition name: (identifier) @name (#set! "kind" "Function") - ) @type)) + ) @symbol)) (source_file (function_definition name: (identifier) @name (#set! "kind" "Function") - ) @type) + ) @symbol) (library_declaration name: (identifier) @name (#set! "kind" "Module") - ) @type + ) @symbol (enum_declaration name: (identifier) @name (#set! "kind" "Enum") - ) @type + ) @symbol (event_definition name: (identifier) @name (#set! "kind" "Event") - ) @type + ) @symbol (struct_declaration name: (identifier) @name (#set! "kind" "Struct") - ) @type + ) @symbol (constructor_definition ("constructor") @name (#set! "kind" "Constructor") - ) @type + ) @symbol (state_variable_declaration - name: (identifier) @name @type + name: (identifier) @name @symbol (#set! "kind" "Field")) diff --git a/queries/teal/aerial.scm b/queries/teal/aerial.scm index d4d10fc..8ac4d6f 100644 --- a/queries/teal/aerial.scm +++ b/queries/teal/aerial.scm @@ -1,14 +1,14 @@ (function_statement name: [(identifier)] @name (#set! "kind" "Function") - ) @type + ) @symbol (var_declaration (var_declarators (var name: (identifier) @name)) (expressions - (anon_function) @type) + (anon_function) @symbol) (#set! "kind" "Function") ) @start @@ -19,11 +19,11 @@ (identifier) (identifier) @name))) (expressions - (anon_function) @type) + (anon_function) @symbol) (#set! "kind" "Function") ) @start (function_statement name: (function_name) @name (#set! "kind" "Function") - ) @type + ) @symbol diff --git a/queries/tsx/aerial.scm b/queries/tsx/aerial.scm index a8c98aa..609df2b 100644 --- a/queries/tsx/aerial.scm +++ b/queries/tsx/aerial.scm @@ -1,48 +1,48 @@ (function_signature name: (identifier) @name (#set! "kind" "Function") - ) @type + ) @symbol (function_declaration name: (identifier) @name (#set! "kind" "Function") - ) @type + ) @symbol (generator_function_declaration name: (identifier) @name (#set! "kind" "Function") - ) @type + ) @symbol (interface_declaration name: (type_identifier) @name (#set! "kind" "Interface") - ) @type + ) @symbol (class_declaration name: (type_identifier) @name (#set! "kind" "Class") - ) @type + ) @symbol (method_definition name: (property_identifier) @name (#set! "kind" "Method") - ) @type + ) @symbol (public_field_definition name: (property_identifier) @name value: (arrow_function) (#set! "kind" "Method") - ) @type + ) @symbol (type_alias_declaration name: (type_identifier) @name (#set! "kind" "Variable") - ) @type + ) @symbol (lexical_declaration (variable_declarator name: (identifier) @name - value: (_) @var_type) @type + value: (_) @var_type) @symbol (#set! "kind" "Variable") ) @start @@ -53,7 +53,7 @@ (string (string_fragment) @name @string))? (#set! "kind" "Function") - ) @type @selection + ) @symbol @selection ; test.skip("this test") (call_expression @@ -65,7 +65,7 @@ (string (string_fragment) @name @string))? (#set! "kind" "Function") - ) @type @selection + ) @symbol @selection ; describe.each([])("Test suite") (call_expression @@ -79,4 +79,4 @@ (string (string_fragment) @name @string))? (#set! "kind" "Function") - ) @type @selection + ) @symbol @selection diff --git a/queries/typescript/aerial.scm b/queries/typescript/aerial.scm index a8c98aa..609df2b 100644 --- a/queries/typescript/aerial.scm +++ b/queries/typescript/aerial.scm @@ -1,48 +1,48 @@ (function_signature name: (identifier) @name (#set! "kind" "Function") - ) @type + ) @symbol (function_declaration name: (identifier) @name (#set! "kind" "Function") - ) @type + ) @symbol (generator_function_declaration name: (identifier) @name (#set! "kind" "Function") - ) @type + ) @symbol (interface_declaration name: (type_identifier) @name (#set! "kind" "Interface") - ) @type + ) @symbol (class_declaration name: (type_identifier) @name (#set! "kind" "Class") - ) @type + ) @symbol (method_definition name: (property_identifier) @name (#set! "kind" "Method") - ) @type + ) @symbol (public_field_definition name: (property_identifier) @name value: (arrow_function) (#set! "kind" "Method") - ) @type + ) @symbol (type_alias_declaration name: (type_identifier) @name (#set! "kind" "Variable") - ) @type + ) @symbol (lexical_declaration (variable_declarator name: (identifier) @name - value: (_) @var_type) @type + value: (_) @var_type) @symbol (#set! "kind" "Variable") ) @start @@ -53,7 +53,7 @@ (string (string_fragment) @name @string))? (#set! "kind" "Function") - ) @type @selection + ) @symbol @selection ; test.skip("this test") (call_expression @@ -65,7 +65,7 @@ (string (string_fragment) @name @string))? (#set! "kind" "Function") - ) @type @selection + ) @symbol @selection ; describe.each([])("Test suite") (call_expression @@ -79,4 +79,4 @@ (string (string_fragment) @name @string))? (#set! "kind" "Function") - ) @type @selection + ) @symbol @selection diff --git a/queries/usd/aerial.scm b/queries/usd/aerial.scm index 69d209c..f187d72 100644 --- a/queries/usd/aerial.scm +++ b/queries/usd/aerial.scm @@ -2,36 +2,36 @@ (string) @name (#offset! @name 0 1 0 -1) (#set! "kind" "Class") -) @type +) @symbol (attribute_assignment [(identifier) (qualified_identifier)] @name (#set! "kind" "Property") -) @type +) @symbol (attribute_declaration [(identifier) (qualified_identifier)] @name (#set! "kind" "Property") -) @type +) @symbol (relationship_assignment [(identifier) (qualified_identifier)] @name (#set! "kind" "Property") -) @type +) @symbol (relationship_declaration [(identifier) (qualified_identifier)] @name (#set! "kind" "Property") -) @type +) @symbol (variant_set_definition (string) @name (#offset! @name 0 1 0 -1) (#set! "kind" "Enum") -) @type +) @symbol (variant (string) @name (#offset! @name 0 1 0 -1) (#set! "kind" "EnumMember") -) @type +) @symbol diff --git a/queries/vim/aerial.scm b/queries/vim/aerial.scm index aa66c46..5c9a558 100644 --- a/queries/vim/aerial.scm +++ b/queries/vim/aerial.scm @@ -2,4 +2,4 @@ (function_declaration name: [(identifier) (scoped_identifier)] @name) (#set! "kind" "Function") - ) @type + ) @symbol diff --git a/queries/vimdoc/aerial.scm b/queries/vimdoc/aerial.scm index 3447cf1..a36e6d1 100644 --- a/queries/vimdoc/aerial.scm +++ b/queries/vimdoc/aerial.scm @@ -2,15 +2,15 @@ (word)+ @name @start (tag) (#set! "kind" "Interface") -) @type +) @symbol (h2 (word)+ @name @start (tag) (#set! "kind" "Interface") -) @type +) @symbol (tag text: (word) @name (#set! "kind" "Interface") -) @type +) @symbol diff --git a/queries/yaml/aerial.scm b/queries/yaml/aerial.scm index 3273a81..3416076 100644 --- a/queries/yaml/aerial.scm +++ b/queries/yaml/aerial.scm @@ -1,11 +1,11 @@ (block_mapping_pair key: (flow_node) @name - value: (block_node (block_mapping) @type) + value: (block_node (block_mapping) @symbol) (#set! "kind" "Class") ) @start (block_mapping_pair key: (flow_node) @name - value: (block_node (block_sequence) @type) + value: (block_node (block_sequence) @symbol) (#set! "kind" "Enum") ) @start