nvim-treesitter/queries/cpp/highlights.scm

97 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
;(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
((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
(auto) @keyword
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
"catch" @exception
"class" @keyword
"constexpr" @keyword
2020-05-23 21:23:05 +02:00
"delete" @keyword
2020-05-23 21:02:43 +02:00
"explicit" @keyword
"final" @exception
"friend" @keyword
"mutable" @keyword
"namespace" @keyword
"noexcept" @keyword
2020-05-23 21:23:05 +02:00
"new" @keyword
2020-05-23 21:02:43 +02:00
"override" @keyword
"private" @keyword
"protected" @keyword
"public" @keyword
"template" @keyword
"throw" @keyword
"try" @exception
"typename" @keyword
"using" @keyword
"virtual" @keyword
2020-05-23 21:23:05 +02:00
"::" @operator