vlang / v-analyzer

The @vlang language server, for all your editing needs like go-to-definition, code completion, type hints, and more.
MIT License
86 stars 9 forks source link

tree_sitter fails to recognize `for mut is` clauses #75

Closed ttytm closed 3 months ago

ttytm commented 3 months ago

Describe the bug

While below would work, adding the mut keyword would result in an error and throwing off things like highlighting:

================================================================================
Simple for is statement
================================================================================
for v is Node {
}
--------------------------------------------------------------------------------

(source_file
  (for_statement
    (is_expression
      (reference_expression
        (identifier))
      (plain_type
        (type_reference_expression
          (identifier))))
    (block)))
================================================================================
Simple for is statement
================================================================================
for mut v is Node {
}
--------------------------------------------------------------------------------

(source_file
  (ERROR
    (mutable_expression
      (mutability_modifiers)
        (ERROR
          (identifier)
            (identifier))
          (map_init_expression))))

Expected Behavior

correctly recognized by parser

Current Behavior

Error

Reproduction Steps

above

Possible Solution

No response

Additional Information/Context

Atm it's hard to tell for me if this isn't an error with tree-sitter itself. @Lycs-D what do you think?

Environment details (v doctor output)

-

Editor name

nvim

v-analyzer Version

-

VS Code Extension Version

No response