mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-04 04:20:09 -04:00
highlights(c/cpp): highlight case labels as constants
This commit is contained in:
parent
1d3111ccb1
commit
e4675bc410
4 changed files with 50 additions and 0 deletions
25
tests/query/highlights/cpp/enums-as-constants.cpp
Normal file
25
tests/query/highlights/cpp/enums-as-constants.cpp
Normal file
|
|
@ -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:
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue