aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephan Seitz <stephan.seitz@fau.de>2020-09-07 20:10:47 +0200
committerThomas Vigouroux <tomvig38@gmail.com>2020-09-08 22:02:39 +0200
commit985c5def34d45d4ba9de19b5d624bacf2ee22c12 (patch)
treecbf7dcd66dc295de4c158b858cd744b314224876
parentAdd C++ folds and C comment/preproc folds (diff)
downloadnvim-treesitter-985c5def34d45d4ba9de19b5d624bacf2ee22c12.tar
nvim-treesitter-985c5def34d45d4ba9de19b5d624bacf2ee22c12.tar.gz
nvim-treesitter-985c5def34d45d4ba9de19b5d624bacf2ee22c12.tar.bz2
nvim-treesitter-985c5def34d45d4ba9de19b5d624bacf2ee22c12.tar.lz
nvim-treesitter-985c5def34d45d4ba9de19b5d624bacf2ee22c12.tar.xz
nvim-treesitter-985c5def34d45d4ba9de19b5d624bacf2ee22c12.tar.zst
nvim-treesitter-985c5def34d45d4ba9de19b5d624bacf2ee22c12.zip
C/C++ locals: Deduplicate C++ locals contained in C
-rw-r--r--queries/c/locals.scm1
-rw-r--r--queries/cpp/locals.scm4
2 files changed, 1 insertions, 4 deletions
diff --git a/queries/c/locals.scm b/queries/c/locals.scm
index fe6e9408c..6a25c7f53 100644
--- a/queries/c/locals.scm
+++ b/queries/c/locals.scm
@@ -44,4 +44,5 @@
(translation_unit)
(function_definition)
(compound_statement) ; a block in curly braces
+ (struct_specifier)
] @scope
diff --git a/queries/cpp/locals.scm b/queries/cpp/locals.scm
index 2108f7caf..aa25a4cd8 100644
--- a/queries/cpp/locals.scm
+++ b/queries/cpp/locals.scm
@@ -7,7 +7,6 @@
;; Class / struct defintions
(class_specifier) @scope
-(struct_specifier) @scope
(reference_declarator
(identifier) @definition.var)
@@ -16,9 +15,6 @@
(identifier) @definition.var)
(struct_specifier
- name: (type_identifier) @definition.type)
-
-(struct_specifier
name: (scoped_type_identifier
name: (type_identifier) @definition.type))