aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Davis2024-03-21 14:05:48 +0000
committerBlaž Hrastnik2024-03-21 15:20:29 +0000
commitf5d95de22784bd33b8dec0edfbfd106582427318 (patch)
tree3a7ce010ff1bb209c90aa59ff2aa707805063522
parentc099dde2a7c28a34a665d304e9a04acbb9c325e4 (diff)
C++: Improve parameter highlighting
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.
-rw-r--r--runtime/queries/cpp/highlights.scm7
1 files changed, 7 insertions, 0 deletions
diff --git a/runtime/queries/cpp/highlights.scm b/runtime/queries/cpp/highlights.scm
index 509dcdf7..c1d14a0b 100644
--- a/runtime/queries/cpp/highlights.scm
+++ b/runtime/queries/cpp/highlights.scm
@@ -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))