feat(highlights): go builtin funcs and types (#5010)

Add highlight scopes for golang built-in functions and types.
Based on https://pkg.go.dev/builtin.
pull/4573/merge
Matouš Dzivjak 2 years ago committed by GitHub
parent f712d316e5
commit 5781aa0264
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,5 +1,9 @@
; Function calls ; Function calls
(call_expression
function: (identifier) @function.builtin
(match? @function.builtin "^(append|cap|close|complex|copy|delete|imag|len|make|new|panic|print|println|real|recover)$"))
(call_expression (call_expression
function: (identifier) @function) function: (identifier) @function)
@ -24,6 +28,9 @@
(parameter_declaration (identifier) @variable.parameter) (parameter_declaration (identifier) @variable.parameter)
(variadic_parameter_declaration (identifier) @variable.parameter) (variadic_parameter_declaration (identifier) @variable.parameter)
((type_identifier) @type.builtin
(match? @type.builtin "^(any|bool|byte|comparable|complex128|complex64|error|float32|float64|int|int16|int32|int64|int8|rune|string|uint|uint16|uint32|uint64|uint8|uintptr)$"))
(type_identifier) @type (type_identifier) @type
(field_identifier) @variable.other.member (field_identifier) @variable.other.member
(identifier) @variable (identifier) @variable

Loading…
Cancel
Save