From f5d95de22784bd33b8dec0edfbfd106582427318 Mon Sep 17 00:00:00 2001 From: Michael Davis Date: Thu, 21 Mar 2024 10:05:48 -0400 Subject: [PATCH] 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; ``` Previously both parameters were only highlighted as variables. --- runtime/queries/cpp/highlights.scm | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/runtime/queries/cpp/highlights.scm b/runtime/queries/cpp/highlights.scm index 509dcdf7d..c1d14a0b1 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))