Closed musjj closed 1 year ago
Tree-Sitter Grammars do not, themselves, do any syntax highlighting.
What IDE/editor/viewer are you using?
Sorry for not being specific, I guess. I'm using neovim, and it seems that problem isn't the highlighting, but the fact that they're not parsed correctly:
Your block of code parses as:
(compilation_unit
(global_statement
(local_declaration_statement
(variable_declaration
(identifier)
(variable_declarator
(identifier)
(equals_value_clause
(invocation_expression
(generic_name
(identifier)
(type_argument_list
(identifier)))
(argument_list
(argument
(string_literal)))))))))
(global_statement
(expression_statement
(invocation_expression
(generic_name
(identifier)
(type_argument_list
(identifier)))
(argument_list
(argument
(string_literal)))))))
So both of them are mapping to the exact same block during the parsing phase. I checkout our tagging system which is used by highlighters as well:
While I'm not familiar with NeoVIM I would suggest trying to disable OmniSharp to see if the syntax on first then matches the syntax on the second.
I've turned off the LSP, but no luck. Weirdly, it seems that it got parsed as a binary expression for me. I wonder if my parser is outdated or something...
I've found this - it seems to be a very recent regression, let me investigate.
Regression introduced in https://github.com/tree-sitter/tree-sitter-c-sharp/pull/294 which also shows a lack of these use cases in the corpus tests.
Should now be working correctly here - neovim-tree-sitter will need to update their reference to the latest commit on master.
Thanks a lot for the swift response! I'll give it a go once they bumped up the commit in the repo.
This is fixed now, thanks a lot!
Casting using a generic method is highlighted incorrectly, when it's assigned to a variable.