diff options
| author | Stephan Seitz <stephan.seitz@fau.de> | 2022-01-29 12:30:55 +0100 |
|---|---|---|
| committer | Stephan Seitz <stephan.seitz@fau.de> | 2022-01-29 12:40:35 +0100 |
| commit | 974e2181a05b4d797d3070628172146a7b60bb3b (patch) | |
| tree | 67179b3a74c2c2fe1f3b0190e7397fdd6210ab64 | |
| parent | supercollider: add support for const (diff) | |
| download | nvim-treesitter-974e2181a05b4d797d3070628172146a7b60bb3b.tar nvim-treesitter-974e2181a05b4d797d3070628172146a7b60bb3b.tar.gz nvim-treesitter-974e2181a05b4d797d3070628172146a7b60bb3b.tar.bz2 nvim-treesitter-974e2181a05b4d797d3070628172146a7b60bb3b.tar.lz nvim-treesitter-974e2181a05b4d797d3070628172146a7b60bb3b.tar.xz nvim-treesitter-974e2181a05b4d797d3070628172146a7b60bb3b.tar.zst nvim-treesitter-974e2181a05b4d797d3070628172146a7b60bb3b.zip | |
highlights(cpp): fix function highlighting of Foo::bar::baz()
Fixes https://github.com/nvim-treesitter/nvim-treesitter/issues/2396
| -rw-r--r-- | queries/cpp/highlights.scm | 10 | ||||
| -rw-r--r-- | tests/query/highlights/cpp/static-namespace-functions.cpp | 12 |
2 files changed, 22 insertions, 0 deletions
diff --git a/queries/cpp/highlights.scm b/queries/cpp/highlights.scm index c991b956c..46ce27bb2 100644 --- a/queries/cpp/highlights.scm +++ b/queries/cpp/highlights.scm @@ -60,6 +60,16 @@ (call_expression function: (qualified_identifier name: (identifier) @function)) +(call_expression + function: (qualified_identifier + name: (qualified_identifier + name: (identifier) @function))) +(call_expression + function: + (qualified_identifier + name: (qualified_identifier + name: (qualified_identifier + name: (identifier) @function)))) (call_expression function: (field_expression diff --git a/tests/query/highlights/cpp/static-namespace-functions.cpp b/tests/query/highlights/cpp/static-namespace-functions.cpp new file mode 100644 index 000000000..1658d5117 --- /dev/null +++ b/tests/query/highlights/cpp/static-namespace-functions.cpp @@ -0,0 +1,12 @@ +// Issue #2396 + +int main() +{ + B::foo(); + // ^ @function + Foo::A::foo(); + // ^ @function + Foo::a::A::foo(); + // ^ @function + return 0; +} |
