diff options
| author | Stephan Seitz <sseitz@nvidia.com> | 2021-12-20 14:50:59 +0100 |
|---|---|---|
| committer | Stephan Seitz <stephan.seitz@fau.de> | 2022-01-29 13:11:56 +0100 |
| commit | e4675bc410ebf7889e63a691f59d5760aec4e0e9 (patch) | |
| tree | 1c42d2a0adb51a35014ec94ed721f7d7b86e63ac /tests/query/highlights/cpp/enums-as-constants.cpp | |
| parent | highlights(c): highlight enum variants as `@constant` (diff) | |
| download | nvim-treesitter-e4675bc410ebf7889e63a691f59d5760aec4e0e9.tar nvim-treesitter-e4675bc410ebf7889e63a691f59d5760aec4e0e9.tar.gz nvim-treesitter-e4675bc410ebf7889e63a691f59d5760aec4e0e9.tar.bz2 nvim-treesitter-e4675bc410ebf7889e63a691f59d5760aec4e0e9.tar.lz nvim-treesitter-e4675bc410ebf7889e63a691f59d5760aec4e0e9.tar.xz nvim-treesitter-e4675bc410ebf7889e63a691f59d5760aec4e0e9.tar.zst nvim-treesitter-e4675bc410ebf7889e63a691f59d5760aec4e0e9.zip | |
highlights(c/cpp): highlight case labels as constants
Diffstat (limited to 'tests/query/highlights/cpp/enums-as-constants.cpp')
| -rw-r--r-- | tests/query/highlights/cpp/enums-as-constants.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/query/highlights/cpp/enums-as-constants.cpp b/tests/query/highlights/cpp/enums-as-constants.cpp new file mode 100644 index 000000000..ae773e8d3 --- /dev/null +++ b/tests/query/highlights/cpp/enums-as-constants.cpp @@ -0,0 +1,25 @@ +enum class Foo{ + a, +// ^ @constant + aa, +// ^ @constant + C, +// ^ @constant +}; + +void foo(Foo f){ + switch ( f ) { + case Foo::a: + // ^ @type + // ^ @namespace + // ^ @constant + break; + case Foo::aa: + // ^ @constant + break; + case Foo::C: + // ^ @constant + break; + default: + } +} |
