highlights(cpp): use more specific groups

This commit is contained in:
ObserverOfTime 2022-10-22 11:09:47 +03:00
parent 7ce62670b2
commit 79705a1f80
2 changed files with 19 additions and 11 deletions

View file

@ -24,6 +24,9 @@
(field_identifier) @method)) @_parent
(#has-parent? @_parent template_method function_declarator call_expression))
(field_declaration
(field_identifier) @field)
(field_initializer
(field_identifier) @property)
@ -31,7 +34,10 @@
declarator: (field_identifier) @method)
(concept_definition
name: (identifier) @type)
name: (identifier) @type.definition)
(alias_declaration
name: (type_identifier) @type.definition)
(namespace_identifier) @namespace
((namespace_identifier) @type
@ -127,28 +133,27 @@
[
"class"
"decltype"
"constexpr"
"explicit"
"final"
"friend"
"mutable"
"namespace"
"override"
"private"
"protected"
"public"
"template"
"typename"
"using"
"virtual"
"co_await"
"concept"
"requires"
"consteval"
"constinit"
(auto)
] @keyword
[
"public"
"private"
"protected"
"virtual"
"final"
] @type.qualifier
[
"co_yield"
"co_return"
@ -175,4 +180,7 @@
"::" @punctuation.delimiter
(template_argument_list
["<" ">"] @punctuation.bracket)
(literal_suffix) @operator

View file

@ -2,7 +2,7 @@
template <class T, class U>
concept Derived = std::is_base_of<U, T>::value;
// ^ keyword
// ^ type
// ^ type.definition
template<typename T>
concept Hashable = requires(T a) {