Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(theming): separate highlight for function declarations #4892

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions book/src/themes.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,9 @@ We use a similar set of scopes as
- `operator` - `||`, `+=`, `>`

- `function`
- `builtin`
- `method`
- `declaration` - Declaration of a function (e.g. `fn foo() { }` in Rust)
- `builtin` - Built-in functions (e.q. `println!` in Rust)
- `method` - Methods
- `macro`
- `special` (preprocessor in C)

Expand Down
6 changes: 3 additions & 3 deletions runtime/queries/c/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,13 @@
(char_literal) @constant.character

(call_expression
function: (identifier) @function)
function: (identifier) @function.declaration)
(call_expression
function: (field_expression
field: (field_identifier) @function))
field: (field_identifier) @function.declaration))
(call_expression (argument_list (identifier) @variable))
(function_declarator
declarator: [(identifier) (field_identifier)] @function)
declarator: [(identifier) (field_identifier)] @function.declaration)
(parameter_declaration
declarator: (identifier) @variable.parameter)
(parameter_declaration
Expand Down
4 changes: 2 additions & 2 deletions runtime/queries/ecma/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
(function
name: (identifier) @function)
(function_declaration
name: (identifier) @function)
name: (identifier) @function.declaration)
(method_definition
name: (property_identifier) @function.method)
name: (property_identifier) @function.declaration)

(pair
key: (property_identifier) @function.method
Expand Down
4 changes: 2 additions & 2 deletions runtime/queries/go/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
; Function definitions

(function_declaration
name: (identifier) @function)
name: (identifier) @function.declaration)

(method_declaration
name: (field_identifier) @function.method)
name: (field_identifier) @function.declaration)

; Identifiers

Expand Down
4 changes: 2 additions & 2 deletions runtime/queries/rust/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -263,10 +263,10 @@
])

(function_item
name: (identifier) @function)
name: (identifier) @function.declaration)

(function_signature_item
name: (identifier) @function)
name: (identifier) @function.declaration)

; ---
; Macros
Expand Down
2 changes: 1 addition & 1 deletion runtime/themes/fleet_dark.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"keyword.control.exception" = "purple"
"operator" = "light"
"function" = "yellow"
"function.macro" = "green"
"function.declaration" = { fg = "lightest", modifiers = ["bold"] }
"function.builtin" = "green"
"function.special" = "green"
"function.method" = "light"
Expand Down