aboutsummaryrefslogtreecommitdiff
path: root/runtime/queries/ada/locals.scm
diff options
context:
space:
mode:
authorDamian Zaręba2024-03-19 12:28:15 +0000
committerGitHub2024-03-19 12:28:15 +0000
commit485c5cf0b81ed1f189c5bb06263667449d5684d6 (patch)
treea5da5324e53af5a6595045f4ad87f5a790feb518 /runtime/queries/ada/locals.scm
parent0b6dea6dc2f78376890beeb31b591987f7f5249b (diff)
Initial Ada language support (after stale) (#9908)
* Adding initial support for ada language, based off #7790 PR from tomekw * More translation to helix-specific tree-sitter scm labels, add ada gpr switch to ada LSP * Generate ada in lang-support.md using cargo xtask docgen * Update tree-sitter definitions according to comments * Remove .gpr glob from languages.toml * Fix unit in languages.toml for ada, update locals.scm to helix needs
Diffstat (limited to 'runtime/queries/ada/locals.scm')
-rw-r--r--runtime/queries/ada/locals.scm32
1 files changed, 32 insertions, 0 deletions
diff --git a/runtime/queries/ada/locals.scm b/runtime/queries/ada/locals.scm
new file mode 100644
index 00000000..e532a2f1
--- /dev/null
+++ b/runtime/queries/ada/locals.scm
@@ -0,0 +1,32 @@
+;; Better highlighting by referencing to the definition, for variable references.
+;; See https://tree-sitter.github.io/tree-sitter/syntax-highlighting#local-variables
+
+(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 (_) @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