nvim-treesitter/queries/cpp/highlights.scm

111 lines
2 KiB
Scheme
Raw Normal View History

2020-05-23 21:02:43 +02:00
((identifier) @field
(#match? @field "^_"))
2020-05-23 21:02:43 +02:00
((identifier) @field
(#match? @field "^m_"))
2020-05-23 21:02:43 +02:00
((identifier) @field
(#match? @field "_$"))
2020-05-23 21:02:43 +02:00
; function(Foo ...foo)
(variadic_parameter_declaration) @parameter
2020-05-23 21:02:43 +02:00
;(field_expression) @parameter ;; How to highlight this?
(template_function
name: (identifier) @function)
(template_method
name: (field_identifier) @method)
(template_function
name: (scoped_identifier
name: (identifier) @function))
(namespace_identifier) @constant
2020-07-06 23:01:46 +02:00
((identifier) @type (#match? @type "^[A-Z]"))
2020-05-23 21:02:43 +02:00
((namespace_identifier) @type
(#match? @type "^[A-Z]"))
2020-05-23 21:02:43 +02:00
((namespace_identifier) @constant
2020-06-14 15:12:38 +02:00
(#match? @constant "^[A-Z][A-Z_0-9]*$"))
2020-05-23 21:02:43 +02:00
(destructor_name
name: (_) @function)
2020-05-23 21:02:43 +02:00
(function_declarator
declarator: (scoped_identifier
name: (identifier) @function))
((function_declarator
declarator: (scoped_identifier
name: (identifier) @constructor))
(#match? @constructor "^[A-Z]"))
2020-05-23 21:02:43 +02:00
(call_expression
function: (scoped_identifier
name: (identifier) @function))
(call_expression
function: (field_expression
field: (field_identifier) @function))
((call_expression
function: (scoped_identifier
name: (identifier) @constructor))
(#match? @constructor "^[A-Z]"))
2020-05-23 21:02:43 +02:00
((call_expression
function: (field_expression
field: (field_identifier) @constructor))
(#match? @constructor "^[A-Z]"))
2020-05-23 21:02:43 +02:00
;; constructing a type in a intizializer list: Constructor (): **SuperType (1)**
((field_initializer
(field_identifier) @constructor
(argument_list))
(#match? @constructor "^[A-Z]"))
2020-05-23 21:02:43 +02:00
2020-05-23 21:23:05 +02:00
2020-05-23 21:02:43 +02:00
; Constants
(this) @constant.builtin
2020-05-23 21:02:43 +02:00
(nullptr) @constant
(true) @boolean
(false) @boolean
; Keywords
[
"try"
"catch"
"noexcept"
"throw"
] @exception
2020-07-06 23:01:46 +02:00
[
"class"
2020-07-20 08:05:30 +02:00
"decltype"
"constexpr"
"delete"
"explicit"
"final"
"friend"
"mutable"
"namespace"
"new"
"override"
"private"
"protected"
"public"
"template"
"typename"
"using"
"virtual"
(auto)
] @keyword
2020-05-23 21:23:05 +02:00
"::" @operator
"..." @operator