Skip to content

Commit

Permalink
C++: Improve parameter highlighting
Browse files Browse the repository at this point in the history
This adds parameter highlighting for reference parameters and defaulted
parameters. For example:

```cpp
auto strip_prefix_only(std::string& s,
                       Hidden_Homonym skip_hidden_homonym = {}) const
    -> Affixing_Result<Prefix>;
```

Previously both parameters were only highlighted as variables.
  • Loading branch information
the-mikedavis authored and Desdaemon committed Mar 26, 2024
1 parent c25a2ef commit 338ac07
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions runtime/queries/cpp/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,13 @@
(this) @variable.builtin
(nullptr) @constant.builtin

; Parameters

(parameter_declaration
declarator: (reference_declarator (identifier) @variable.parameter))
(optional_parameter_declaration
declarator: (identifier) @variable.parameter)

; Keywords

(template_argument_list (["<" ">"] @punctuation.bracket))
Expand Down

0 comments on commit 338ac07

Please sign in to comment.