tree-sitter-c-sharp icon indicating copy to clipboard operation
tree-sitter-c-sharp copied to clipboard

Fix wrong parsing when a function call with a (one or more) variable …

Open Sveder opened this issue 1 year ago • 3 comments

…is inside a using statement. Instead of being parsed as invocation_expression it is being parsed as variable_declaration because of tuple_pattern.

Sveder avatar Mar 17 '24 08:03 Sveder

Might be an acceptable fix for: https://github.com/tree-sitter/tree-sitter-c-sharp/issues/326

Sveder avatar Mar 17 '24 08:03 Sveder

So while it solves one individual issue this breaks things by renaming variable_declaration to using_variable_declaration (and the same for declarators). Sometimes we'll take that break where we're better matching the Roslyn grammar/official C# syntax but they don't the using prefix either.

Best option here might be to see if you can keep the new using patterns but alias them so they don't have the using prefix (there are some examples in the grammar).

damieng avatar Apr 07 '24 09:04 damieng

@damieng @tamasvajk First of all, thanks for taking a look. Much appreciated. Second of all, some of your questions are somewhat over my head. I'm definitely not a C#/Roslyn expert (yet :)). I'd love some of your guidance in how to fix this better.

Sveder avatar Apr 14 '24 15:04 Sveder