From 4414448c084b50b9fb2434cb35cc989e66f9488e Mon Sep 17 00:00:00 2001 From: KhazAkar Date: Tue, 12 Mar 2024 22:46:09 +0100 Subject: [PATCH 1/6] Adding initial support for ada language, based off #7790 PR from tomekw --- languages.toml | 15 +++ runtime/queries/ada/folds.scm | 15 +++ runtime/queries/ada/highlights.scm | 178 ++++++++++++++++++++++++++++ runtime/queries/ada/locals.scm | 33 ++++++ runtime/queries/ada/textobjects.scm | 23 ++++ 5 files changed, 264 insertions(+) create mode 100644 runtime/queries/ada/folds.scm create mode 100644 runtime/queries/ada/highlights.scm create mode 100644 runtime/queries/ada/locals.scm create mode 100644 runtime/queries/ada/textobjects.scm diff --git a/languages.toml b/languages.toml index bf726e349721..66461e337da4 100644 --- a/languages.toml +++ b/languages.toml @@ -6,6 +6,7 @@ use-grammars = { except = [ "hare", "wren", "gemini" ] } [language-server] als = { command = "als" } +ada-language-server = { command = "ada_language_server" } awk-language-server = { command = "awk-language-server" } bash-language-server = { command = "bash-language-server", args = ["start"] } bass = { command = "bass", args = ["--lsp"] } @@ -2337,6 +2338,20 @@ language-servers = [ "jsonnet-language-server" ] name = "jsonnet" source = { git = "https://github.com/sourcegraph/tree-sitter-jsonnet", rev = "0475a5017ad7dc84845d1d33187f2321abcb261d" } +[[language]] +name = "ada" +scope = "source.ada" +injection-regex = "ada" +file-types = ["adb", "ads"] +roots = ["alire.toml", "*.gpr"] +comment-token = "--" +indent = { tab-width = 3, unit = " " } +language-servers = [ "ada-language-server" ] + +[[grammar]] +name = "ada" +source = { git = "https://github.com/briot/tree-sitter-ada", rev = "ba0894efa03beb70780156b91e28c716b7a4764d" } + [[language]] name = "astro" scope = "source.astro" diff --git a/runtime/queries/ada/folds.scm b/runtime/queries/ada/folds.scm new file mode 100644 index 000000000000..819d92ccdd69 --- /dev/null +++ b/runtime/queries/ada/folds.scm @@ -0,0 +1,15 @@ +; Support for folding in Ada +;; za toggles folding a package, subprogram, if statement or loop + +[ + (package_declaration) + (generic_package_declaration) + (package_body) + (subprogram_declaration) + (subprogram_body) + (block_statement) + (if_statement) + (loop_statement) + (gnatprep_declarative_if_statement) + (gnatprep_if_statement) +] @fold diff --git a/runtime/queries/ada/highlights.scm b/runtime/queries/ada/highlights.scm new file mode 100644 index 000000000000..a39309598af4 --- /dev/null +++ b/runtime/queries/ada/highlights.scm @@ -0,0 +1,178 @@ +;; highlight queries. +;; See the syntax at https://tree-sitter.github.io/tree-sitter/using-parsers#pattern-matching-with-queries +;; See also https://github.com/nvim-treesitter/nvim-treesitter/blob/master/CONTRIBUTING.md#parser-configurations +;; for a list of recommended @ tags, though not all of them have matching +;; highlights in neovim. + +[ + "abort" + "abs" + "abstract" + "accept" + "access" + "all" + "array" + "at" + "begin" + "declare" + "delay" + "delta" + "digits" + "do" + "end" + "entry" + "exit" + "generic" + "interface" + "is" + "limited" + "of" + "others" + "out" + "pragma" + "private" + "range" + "synchronized" + "tagged" + "task" + "terminate" + "until" + "when" +] @keyword +[ + "null" +] @constant.builtin +[ + "aliased" + "constant" + "renames" +] @storageclass +[ + "mod" + "new" + "protected" + "record" + "subtype" + "type" +] @type +[ + "with" + "use" +] @keyword.control.import +[ + "body" + "function" + "overriding" + "procedure" + "package" + "separate" +] @keyword.function +[ + "and" + "in" + "not" + "or" + "xor" +] @operator +[ + "while" + "loop" + "for" + "parallel" + "reverse" + "some" +] @kewyord.control.repeat +[ + "return" +] @keyword.control.return +[ + "case" + "if" + "else" + "then" + "elsif" + "select" +] @keyword.control.conditional +[ + "exception" + "raise" +] @keyword.control.exception +(comment) @comment +(comment) @spell ;; spell-check comments +(string_literal) @string +(string_literal) @spell ;; spell-check strings +(character_literal) @string +(numeric_literal) @constant.numeric + +;; Highlight the name of subprograms +(procedure_specification name: (_) @function.builtin) +(function_specification name: (_) @function.builtin) +(package_declaration name: (_) @function.builtin) +(package_body name: (_) @function.builtin) +(generic_instantiation name: (_) @function.builtin) +(entry_declaration . (identifier) @function.builtin) + +;; Some keywords should take different categories depending on the context +(use_clause "use" @keyword.control.import "type" @keyword.control.import) +(with_clause "private" @keyword.control.import) +(with_clause "limited" @keyword.control.import) +(use_clause (_) @namespace) +(with_clause (_) @namespace) + +(loop_statement "end" @keyword.control.repeat) +(if_statement "end" @keyword.control.conditional) +(loop_parameter_specification "in" @keyword.control.repeat) +(loop_parameter_specification "in" @keyword.control.repeat) +(iterator_specification ["in" "of"] @keyword.control.repeat) +(range_attribute_designator "range" @keyword.control.repeat) + +(raise_statement "with" @keyword.control.exception) + +(gnatprep_declarative_if_statement) @preproc +(gnatprep_if_statement) @preproc +(gnatprep_identifier) @preproc + +(subprogram_declaration "is" @keyword.function "abstract" @keyword.function) +(aspect_specification "with" @keyword.function) + +(full_type_declaration "is" @type) +(subtype_declaration "is" @type) +(record_definition "end" @type) +(full_type_declaration (_ "access" @type)) +(array_type_definition "array" @type "of" @type) +(access_to_object_definition "access" @type) +(access_to_object_definition "access" @type + [ + (general_access_modifier "constant" @type) + (general_access_modifier "all" @type) + ] +) +(range_constraint "range" @type) +(signed_integer_type_definition "range" @type) +(index_subtype_definition "range" @type) +(record_type_definition "abstract" @type) +(record_type_definition "tagged" @type) +(record_type_definition "limited" @type) +(record_type_definition (record_definition "null" @type)) +(private_type_declaration "is" @type "private" @type) +(private_type_declaration "tagged" @type) +(private_type_declaration "limited" @type) +(task_type_declaration "task" @type "is" @type) + +;; Gray the body of expression functions +(expression_function_declaration + (function_specification) + "is" + (_) @attribute +) +(subprogram_declaration (aspect_specification) @attribute) + +;; Highlight full subprogram specifications +;(subprogram_body +; [ +; (procedure_specification) +; (function_specification) +; ] @function.builtin.spec +;) + + diff --git a/runtime/queries/ada/locals.scm b/runtime/queries/ada/locals.scm new file mode 100644 index 000000000000..eda50c6c03a6 --- /dev/null +++ b/runtime/queries/ada/locals.scm @@ -0,0 +1,33 @@ +;; Better highlighting by referencing to the definition, for variable +;; references. However, this is not yet supported by neovim +;; See https://tree-sitter.github.io/tree-sitter/syntax-highlighting#local-variables + +(compilation) @scope +(package_declaration) @scope +(package_body) @scope +(subprogram_declaration) @scope +(subprogram_body) @scope +(block_statement) @scope + +(with_clause (_) @definition.import) +(procedure_specification name: (_) @definition.function) +(function_specification name: (_) @definition.function) +(package_declaration name: (_) @definition.var) +(package_body name: (_) @definition.var) +(generic_instantiation . name: (_) @definition.var) +(component_declaration . (identifier) @definition.var) +(exception_declaration . (identifier) @definition.var) +(formal_object_declaration . (identifier) @definition.var) +(object_declaration . (identifier) @definition.var) +(parameter_specification . (identifier) @definition.var) +(full_type_declaration . (identifier) @definition.type) +(private_type_declaration . (identifier) @definition.type) +(private_extension_declaration . (identifier) @definition.type) +(incomplete_type_declaration . (identifier) @definition.type) +(protected_type_declaration . (identifier) @definition.type) +(formal_complete_type_declaration . (identifier) @definition.type) +(formal_incomplete_type_declaration . (identifier) @definition.type) +(task_type_declaration . (identifier) @definition.type) +(subtype_declaration . (identifier) @definition.type) + +(identifier) @reference diff --git a/runtime/queries/ada/textobjects.scm b/runtime/queries/ada/textobjects.scm new file mode 100644 index 000000000000..5d81701ac168 --- /dev/null +++ b/runtime/queries/ada/textobjects.scm @@ -0,0 +1,23 @@ +;; Support for high-level text objects selections. +;; For instance: +;; vaf (v)isually select (a) (f)unction or subprogram +;; vif (v)isually select (i)nside a (f)unction or subprogram +;; vai (v)isually select (a) (i)f statement (or loop) +;; vii (v)isually select (i)nside an (i)f statement (or loop) +;; +;; https://github.com/nvim-treesitter/nvim-treesitter-textobjects/blob/master/README.md + +(subprogram_body) @function.outer +(subprogram_body (non_empty_declarative_part) @function.inner) +(subprogram_body (handled_sequence_of_statements) @function.inner) +(function_specification) @function.outer +(procedure_specification) @function.outer +(package_declaration) @function.outer +(generic_package_declaration) @function.outer +(package_body) @function.outer +(if_statement) @block.outer +(if_statement statements: (_) @block.inner) +(if_statement else_statements: (_) @block.inner) +(elsif_statement_item statements: (_) @block.inner) +(loop_statement) @block.outer +(loop_statement statements: (_) @block.inner) From 0f2fa88cc5d5fce8ed4395f35e5d2e70a92f63d6 Mon Sep 17 00:00:00 2001 From: KhazAkar Date: Sun, 17 Mar 2024 16:15:16 +0100 Subject: [PATCH 2/6] More translation to helix-specific tree-sitter scm labels, add ada gpr switch to ada LSP --- languages.toml | 6 ++-- runtime/queries/ada/highlights.scm | 56 ++++++++++++++--------------- runtime/queries/ada/textobjects.scm | 28 +++++++-------- 3 files changed, 46 insertions(+), 44 deletions(-) diff --git a/languages.toml b/languages.toml index 150380ae076b..74333ef794e5 100644 --- a/languages.toml +++ b/languages.toml @@ -7,6 +7,7 @@ use-grammars = { except = [ "hare", "wren", "gemini" ] } als = { command = "als" } ada-language-server = { command = "ada_language_server" } +ada-gpr-language-server = {command = "ada_language_server", args = ["--language-gpr"]} awk-language-server = { command = "awk-language-server" } bash-language-server = { command = "bash-language-server", args = ["start"] } bass = { command = "bass", args = ["--lsp"] } @@ -2341,11 +2342,12 @@ source = { git = "https://github.com/sourcegraph/tree-sitter-jsonnet", rev = "04 name = "ada" scope = "source.ada" injection-regex = "ada" -file-types = ["adb", "ads"] +file-types = ["adb", "ads", "gpr"] roots = ["alire.toml", "*.gpr"] comment-token = "--" indent = { tab-width = 3, unit = " " } -language-servers = [ "ada-language-server" ] +language-servers = ["ada-language-server", "ada-gpr-language-server"] + [[grammar]] name = "ada" diff --git a/runtime/queries/ada/highlights.scm b/runtime/queries/ada/highlights.scm index a39309598af4..cf7ac363933f 100644 --- a/runtime/queries/ada/highlights.scm +++ b/runtime/queries/ada/highlights.scm @@ -46,7 +46,7 @@ "aliased" "constant" "renames" -] @storageclass +] @keyword.storage [ "mod" "new" @@ -54,7 +54,7 @@ "record" "subtype" "type" -] @type +] @type.builtin [ "with" "use" @@ -135,29 +135,29 @@ (subprogram_declaration "is" @keyword.function "abstract" @keyword.function) (aspect_specification "with" @keyword.function) -(full_type_declaration "is" @type) -(subtype_declaration "is" @type) -(record_definition "end" @type) -(full_type_declaration (_ "access" @type)) -(array_type_definition "array" @type "of" @type) -(access_to_object_definition "access" @type) -(access_to_object_definition "access" @type +(full_type_declaration "is" @type.builtin) +(subtype_declaration "is" @type.builtin) +(record_definition "end" @type.builtin) +(full_type_declaration (_ "access" @type.builtin)) +(array_type_definition "array" @type.builtin "of" @type.builtin) +(access_to_object_definition "access" @type.builtin) +(access_to_object_definition "access" @type.builtin [ - (general_access_modifier "constant" @type) - (general_access_modifier "all" @type) + (general_access_modifier "constant" @type.builtin) + (general_access_modifier "all" @type.builtin) ] ) -(range_constraint "range" @type) -(signed_integer_type_definition "range" @type) -(index_subtype_definition "range" @type) -(record_type_definition "abstract" @type) -(record_type_definition "tagged" @type) -(record_type_definition "limited" @type) -(record_type_definition (record_definition "null" @type)) -(private_type_declaration "is" @type "private" @type) -(private_type_declaration "tagged" @type) -(private_type_declaration "limited" @type) -(task_type_declaration "task" @type "is" @type) +(range_constraint "range" @type.builtin) +(signed_integer_type_definition "range" @type.builtin) +(index_subtype_definition "range" @type.builtin) +(record_type_definition "abstract" @type.builtin) +(record_type_definition "tagged" @type.builtin) +(record_type_definition "limited" @type.builtin) +(record_type_definition (record_definition "null" @type.builtin)) +(private_type_declaration "is" @type.builtin "private" @type.builtin) +(private_type_declaration "tagged" @type.builtin) +(private_type_declaration "limited" @type.builtin) +(task_type_declaration "task" @type.builtin "is" @type.builtin) ;; Gray the body of expression functions (expression_function_declaration @@ -168,11 +168,11 @@ (subprogram_declaration (aspect_specification) @attribute) ;; Highlight full subprogram specifications -;(subprogram_body -; [ -; (procedure_specification) -; (function_specification) -; ] @function.builtin.spec -;) +; (subprogram_body +; [ +; (procedure_specification) +; (function_specification) +; ] @function.builtin.spec +; ) diff --git a/runtime/queries/ada/textobjects.scm b/runtime/queries/ada/textobjects.scm index 5d81701ac168..3d7ce72d5299 100644 --- a/runtime/queries/ada/textobjects.scm +++ b/runtime/queries/ada/textobjects.scm @@ -7,17 +7,17 @@ ;; ;; https://github.com/nvim-treesitter/nvim-treesitter-textobjects/blob/master/README.md -(subprogram_body) @function.outer -(subprogram_body (non_empty_declarative_part) @function.inner) -(subprogram_body (handled_sequence_of_statements) @function.inner) -(function_specification) @function.outer -(procedure_specification) @function.outer -(package_declaration) @function.outer -(generic_package_declaration) @function.outer -(package_body) @function.outer -(if_statement) @block.outer -(if_statement statements: (_) @block.inner) -(if_statement else_statements: (_) @block.inner) -(elsif_statement_item statements: (_) @block.inner) -(loop_statement) @block.outer -(loop_statement statements: (_) @block.inner) +(subprogram_body) @function.around +(subprogram_body (non_empty_declarative_part) @function.inside) +(subprogram_body (handled_sequence_of_statements) @function.inside) +(function_specification) @function.around +(procedure_specification) @function.around +(package_declaration) @function.around +(generic_package_declaration) @function.around +(package_body) @function.around +(if_statement) @object.around +(if_statement statements: (_) @object.inside) +(if_statement else_statements: (_) @object.inside) +(elsif_statement_item statements: (_) @object.inside) +(loop_statement) @object.around +(loop_statement statements: (_) @object.inside) From 84f847af8f25948adb545fd65b809b0f50af31cc Mon Sep 17 00:00:00 2001 From: KhazAkar Date: Sun, 17 Mar 2024 20:05:38 +0100 Subject: [PATCH 3/6] Generate ada in lang-support.md using cargo xtask docgen --- book/src/generated/lang-support.md | 1 + 1 file changed, 1 insertion(+) diff --git a/book/src/generated/lang-support.md b/book/src/generated/lang-support.md index 7792bf594181..a8724858cea9 100644 --- a/book/src/generated/lang-support.md +++ b/book/src/generated/lang-support.md @@ -1,5 +1,6 @@ | Language | Syntax Highlighting | Treesitter Textobjects | Auto Indent | Default LSP | | --- | --- | --- | --- | --- | +| ada | ✓ | ✓ | | `ada_language_server`, `ada_language_server` | | agda | ✓ | | | | | astro | ✓ | | | | | awk | ✓ | ✓ | | `awk-language-server` | From 788a93df34b509e38209227d4ce437fa3f40a18a Mon Sep 17 00:00:00 2001 From: KhazAkar Date: Mon, 18 Mar 2024 18:43:14 +0100 Subject: [PATCH 4/6] Update tree-sitter definitions according to comments --- runtime/queries/ada/highlights.scm | 8 ++-- runtime/queries/ada/locals.scm | 57 ++++++++++++++--------------- runtime/queries/ada/textobjects.scm | 20 +++++----- 3 files changed, 40 insertions(+), 45 deletions(-) diff --git a/runtime/queries/ada/highlights.scm b/runtime/queries/ada/highlights.scm index cf7ac363933f..643fbd66457b 100644 --- a/runtime/queries/ada/highlights.scm +++ b/runtime/queries/ada/highlights.scm @@ -98,9 +98,7 @@ "raise" ] @keyword.control.exception (comment) @comment -(comment) @spell ;; spell-check comments (string_literal) @string -(string_literal) @spell ;; spell-check strings (character_literal) @string (numeric_literal) @constant.numeric @@ -128,9 +126,9 @@ (raise_statement "with" @keyword.control.exception) -(gnatprep_declarative_if_statement) @preproc -(gnatprep_if_statement) @preproc -(gnatprep_identifier) @preproc +(gnatprep_declarative_if_statement) @keyword.directive +(gnatprep_if_statement) @keyword.directive +(gnatprep_identifier) @keyword.directive (subprogram_declaration "is" @keyword.function "abstract" @keyword.function) (aspect_specification "with" @keyword.function) diff --git a/runtime/queries/ada/locals.scm b/runtime/queries/ada/locals.scm index eda50c6c03a6..90d9e5bb5898 100644 --- a/runtime/queries/ada/locals.scm +++ b/runtime/queries/ada/locals.scm @@ -1,33 +1,32 @@ -;; Better highlighting by referencing to the definition, for variable -;; references. However, this is not yet supported by neovim +;; Better highlighting by referencing to the definition, for variable references. ;; See https://tree-sitter.github.io/tree-sitter/syntax-highlighting#local-variables -(compilation) @scope -(package_declaration) @scope -(package_body) @scope -(subprogram_declaration) @scope -(subprogram_body) @scope -(block_statement) @scope +(compilation) @local.scope +(package_declaration) @local.scope +(package_body) @local.scope +(subprogram_declaration) @local.scope +(subprogram_body) @local.scope +(block_statement) @local.scope -(with_clause (_) @definition.import) -(procedure_specification name: (_) @definition.function) -(function_specification name: (_) @definition.function) -(package_declaration name: (_) @definition.var) -(package_body name: (_) @definition.var) -(generic_instantiation . name: (_) @definition.var) -(component_declaration . (identifier) @definition.var) -(exception_declaration . (identifier) @definition.var) -(formal_object_declaration . (identifier) @definition.var) -(object_declaration . (identifier) @definition.var) -(parameter_specification . (identifier) @definition.var) -(full_type_declaration . (identifier) @definition.type) -(private_type_declaration . (identifier) @definition.type) -(private_extension_declaration . (identifier) @definition.type) -(incomplete_type_declaration . (identifier) @definition.type) -(protected_type_declaration . (identifier) @definition.type) -(formal_complete_type_declaration . (identifier) @definition.type) -(formal_incomplete_type_declaration . (identifier) @definition.type) -(task_type_declaration . (identifier) @definition.type) -(subtype_declaration . (identifier) @definition.type) +(with_clause (_) @local.definition.import) +(procedure_specification name: (_) @local.definition.function) +(function_specification name: (_) @local.definition.function) +(package_declaration name: (_) @local.definition.var) +(package_body name: (_) @local.definition.var) +(generic_instantiation . name: (_) @local.definition.var) +(component_declaration . (identifier) @local.definition.var) +(exception_declaration . (identifier) @local.definition.var) +(formal_object_declaration . (identifier) @local.definition.var) +(object_declaration . (identifier) @local.definition.var) +(parameter_specification . (identifier) @local.definition.var) +(full_type_declaration . (identifier) @local.definition.type) +(private_type_declaration . (identifier) @local.definition.type) +(private_extension_declaration . (identifier) @local.definition.type) +(incomplete_type_declaration . (identifier) @local.definition.type) +(protected_type_declaration . (identifier) @local.definition.type) +(formal_complete_type_declaration . (identifier) @local.definition.type) +(formal_incomplete_type_declaration . (identifier) @local.definition.type) +(task_type_declaration . (identifier) @local.definition.type) +(subtype_declaration . (identifier) @local.definition.type) -(identifier) @reference +(identifier) @local.reference diff --git a/runtime/queries/ada/textobjects.scm b/runtime/queries/ada/textobjects.scm index 3d7ce72d5299..284b4125652d 100644 --- a/runtime/queries/ada/textobjects.scm +++ b/runtime/queries/ada/textobjects.scm @@ -1,11 +1,15 @@ ;; Support for high-level text objects selections. ;; For instance: -;; vaf (v)isually select (a) (f)unction or subprogram -;; vif (v)isually select (i)nside a (f)unction or subprogram -;; vai (v)isually select (a) (i)f statement (or loop) -;; vii (v)isually select (i)nside an (i)f statement (or loop) +;; maf (v)isually select (a) (f)unction or subprogram +;; mif (v)isually select (i)nside a (f)unction or subprogram +;; mai (v)isually select (a) (i)f statement (or loop) +;; mii (v)isually select (i)nside an (i)f statement (or loop) ;; -;; https://github.com/nvim-treesitter/nvim-treesitter-textobjects/blob/master/README.md +;; For navigations using textobjects, check link below: +;; https://docs.helix-editor.com/master/usage.html#navigating-using-tree-sitter-textobjects +;; +;; For Textobject queries explaination, check out link below: +;; https://docs.helix-editor.com/master/guides/textobject.html (subprogram_body) @function.around (subprogram_body (non_empty_declarative_part) @function.inside) @@ -15,9 +19,3 @@ (package_declaration) @function.around (generic_package_declaration) @function.around (package_body) @function.around -(if_statement) @object.around -(if_statement statements: (_) @object.inside) -(if_statement else_statements: (_) @object.inside) -(elsif_statement_item statements: (_) @object.inside) -(loop_statement) @object.around -(loop_statement statements: (_) @object.inside) From ecd5238b6c317bc628d7b126edbfe0c9bb0cb468 Mon Sep 17 00:00:00 2001 From: KhazAkar Date: Mon, 18 Mar 2024 18:47:00 +0100 Subject: [PATCH 5/6] Remove .gpr glob from languages.toml --- languages.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/languages.toml b/languages.toml index 74333ef794e5..c057ddfaae50 100644 --- a/languages.toml +++ b/languages.toml @@ -2343,7 +2343,7 @@ name = "ada" scope = "source.ada" injection-regex = "ada" file-types = ["adb", "ads", "gpr"] -roots = ["alire.toml", "*.gpr"] +roots = ["alire.toml"] comment-token = "--" indent = { tab-width = 3, unit = " " } language-servers = ["ada-language-server", "ada-gpr-language-server"] From 696f6cc483a435c0979fbcf5434cce5e859f142f Mon Sep 17 00:00:00 2001 From: KhazAkar Date: Tue, 19 Mar 2024 02:27:34 +0100 Subject: [PATCH 6/6] Fix unit in languages.toml for ada, update locals.scm to helix needs --- languages.toml | 2 +- runtime/queries/ada/locals.scm | 40 +++++++++++++++++----------------- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/languages.toml b/languages.toml index c057ddfaae50..a738be4c4c32 100644 --- a/languages.toml +++ b/languages.toml @@ -2345,7 +2345,7 @@ injection-regex = "ada" file-types = ["adb", "ads", "gpr"] roots = ["alire.toml"] comment-token = "--" -indent = { tab-width = 3, unit = " " } +indent = { tab-width = 3, unit = " " } language-servers = ["ada-language-server", "ada-gpr-language-server"] diff --git a/runtime/queries/ada/locals.scm b/runtime/queries/ada/locals.scm index 90d9e5bb5898..e532a2f17c15 100644 --- a/runtime/queries/ada/locals.scm +++ b/runtime/queries/ada/locals.scm @@ -8,25 +8,25 @@ (subprogram_body) @local.scope (block_statement) @local.scope -(with_clause (_) @local.definition.import) -(procedure_specification name: (_) @local.definition.function) -(function_specification name: (_) @local.definition.function) -(package_declaration name: (_) @local.definition.var) -(package_body name: (_) @local.definition.var) -(generic_instantiation . name: (_) @local.definition.var) -(component_declaration . (identifier) @local.definition.var) -(exception_declaration . (identifier) @local.definition.var) -(formal_object_declaration . (identifier) @local.definition.var) -(object_declaration . (identifier) @local.definition.var) -(parameter_specification . (identifier) @local.definition.var) -(full_type_declaration . (identifier) @local.definition.type) -(private_type_declaration . (identifier) @local.definition.type) -(private_extension_declaration . (identifier) @local.definition.type) -(incomplete_type_declaration . (identifier) @local.definition.type) -(protected_type_declaration . (identifier) @local.definition.type) -(formal_complete_type_declaration . (identifier) @local.definition.type) -(formal_incomplete_type_declaration . (identifier) @local.definition.type) -(task_type_declaration . (identifier) @local.definition.type) -(subtype_declaration . (identifier) @local.definition.type) +(with_clause (_) @local.definition) +(procedure_specification name: (_) @local.definition) +(function_specification name: (_) @local.definition) +(package_declaration name: (_) @local.definition) +(package_body name: (_) @local.definition) +(generic_instantiation . name: (_) @local.definition) +(component_declaration . (identifier) @local.definition) +(exception_declaration . (identifier) @local.definition) +(formal_object_declaration . (identifier) @local.definition) +(object_declaration . (identifier) @local.definition) +(parameter_specification . (identifier) @local.definition) +(full_type_declaration . (identifier) @local.definition) +(private_type_declaration . (identifier) @local.definition) +(private_extension_declaration . (identifier) @local.definition) +(incomplete_type_declaration . (identifier) @local.definition) +(protected_type_declaration . (identifier) @local.definition) +(formal_complete_type_declaration . (identifier) @local.definition) +(formal_incomplete_type_declaration . (identifier) @local.definition) +(task_type_declaration . (identifier) @local.definition) +(subtype_declaration . (identifier) @local.definition) (identifier) @local.reference