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

View file

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