From f5c4671bfbad96bf346bd7e9a21fc4317b4959df Mon Sep 17 00:00:00 2001 From: Indrajith K L Date: Sat, 3 Dec 2022 17:00:20 +0530 Subject: Adds most of the tools --- .../runtime/queries/perl/highlights.scm | 181 +++++++++++++++++++++ .../runtime/queries/perl/indents.toml | 17 ++ .../runtime/queries/perl/injections.scm | 2 + .../runtime/queries/perl/textobjects.scm | 17 ++ 4 files changed, 217 insertions(+) create mode 100644 helix-22.03-x86_64-windows/runtime/queries/perl/highlights.scm create mode 100644 helix-22.03-x86_64-windows/runtime/queries/perl/indents.toml create mode 100644 helix-22.03-x86_64-windows/runtime/queries/perl/injections.scm create mode 100644 helix-22.03-x86_64-windows/runtime/queries/perl/textobjects.scm (limited to 'helix-22.03-x86_64-windows/runtime/queries/perl') diff --git a/helix-22.03-x86_64-windows/runtime/queries/perl/highlights.scm b/helix-22.03-x86_64-windows/runtime/queries/perl/highlights.scm new file mode 100644 index 0000000..b6f0429 --- /dev/null +++ b/helix-22.03-x86_64-windows/runtime/queries/perl/highlights.scm @@ -0,0 +1,181 @@ +; Variables +(variable_declaration + . + (scope) @keyword) +[ +(single_var_declaration) +(scalar_variable) +(array_variable) +(hash_variable) +(hash_variable) +] @variable + + +[ +(package_name) +(special_scalar_variable) +(special_array_variable) +(special_hash_variable) +(special_literal) +(super) +] @constant + +( + [ + (package_name) + (super) + ] + . + ("::" @operator) +) + +(comments) @comment +(pod_statement) @comment.block.documentation + +[ +(use_no_statement) +(use_no_feature_statement) +(use_no_if_statement) +(use_no_version) +(use_constant_statement) +(use_parent_statement) +] @keyword + +(use_constant_statement + constant: (identifier) @constant) + +[ +"require" +] @keyword + +(method_invocation + . + (identifier) @variable) + +(method_invocation + (arrow_operator) + . + (identifier) @function) +(method_invocation + function_name: (identifier) @function) +(named_block_statement + function_name: (identifier) @function) + +(call_expression + function_name: (identifier) @function) +(function_definition + name: (identifier) @function) +[ +(function) +(map) +(grep) +(bless) +] @function + +[ +"return" +"sub" +"package" +"BEGIN" +"END" +] @keyword.function + +[ +"(" +")" +"[" +"]" +"{" +"}" +] @punctuation.bracket +(standard_input_to_variable) @punctuation.bracket + +[ +"=~" +"or" +"=" +"==" +"+" +"-" +"." +"//" +"||" +(arrow_operator) +(hash_arrow_operator) +(array_dereference) +(hash_dereference) +(to_reference) +(type_glob) +(hash_access_variable) +(ternary_expression) +(ternary_expression_in_hash) +] @operator + +[ +(regex_option) +(regex_option_for_substitution) +(regex_option_for_transliteration) +] @variable.parameter + +(type_glob + (identifier) @variable) +( + (scalar_variable) + . + ("->" @operator)) + +[ +(word_list_qw) +(command_qx_quoted) +(string_single_quoted) +(string_double_quoted) +(string_qq_quoted) +(bareword) +(transliteration_tr_or_y) +] @string + +[ +(regex_pattern_qr) +(patter_matcher_m) +(substitution_pattern_s) +] @string.regexp + +(escape_sequence) @string.special + +[ +"," +(semi_colon) +(start_delimiter) +(end_delimiter) +(ellipsis_statement) +] @punctuation.delimiter + +[ +(integer) +(floating_point) +(scientific_notation) +(hexadecimal) +] @constant.numeric + +[ +; (if_statement) +(unless_statement) +(if_simple_statement) +(unless_simple_statement) +] @keyword.control.conditional + +[ +"if" +"elsif" +"else" +] @keyword.control.conditional + +(foreach_statement) @keyword.control.repeat +(foreach_statement + . + (scope) @keyword) + +(function_attribute) @label + +(function_signature) @type + diff --git a/helix-22.03-x86_64-windows/runtime/queries/perl/indents.toml b/helix-22.03-x86_64-windows/runtime/queries/perl/indents.toml new file mode 100644 index 0000000..365e066 --- /dev/null +++ b/helix-22.03-x86_64-windows/runtime/queries/perl/indents.toml @@ -0,0 +1,17 @@ +indent = [ + "function", + "identifier", + "method_invocation", + "if_statement", + "unless_statement", + "if_simple_statement", + "unless_simple_statement", + "variable_declaration", + "block", + "list_item", + "word_list_qw" +] + +outdent = [ + "}" +] diff --git a/helix-22.03-x86_64-windows/runtime/queries/perl/injections.scm b/helix-22.03-x86_64-windows/runtime/queries/perl/injections.scm new file mode 100644 index 0000000..cab5f53 --- /dev/null +++ b/helix-22.03-x86_64-windows/runtime/queries/perl/injections.scm @@ -0,0 +1,2 @@ +((comments) @injection.content + (#set! injection.language "comment")) diff --git a/helix-22.03-x86_64-windows/runtime/queries/perl/textobjects.scm b/helix-22.03-x86_64-windows/runtime/queries/perl/textobjects.scm new file mode 100644 index 0000000..972b877 --- /dev/null +++ b/helix-22.03-x86_64-windows/runtime/queries/perl/textobjects.scm @@ -0,0 +1,17 @@ +(function_definition + (identifier) (_) @function.inside) @function.around + +(anonymous_function + (_) @function.inside) @function.around + +(argument + (_) @parameter.inside) + +[ + (comments) + (pod_statement) +] @comment.inside + +(comments)+ @comment.around + +(pod_statement) @comment.around -- cgit v1.2.3