Comments (9)
I've found this - it seems to be a very recent regression, let me investigate.
from tree-sitter-c-sharp.
Tree-Sitter Grammars do not, themselves, do any syntax highlighting.
What IDE/editor/viewer are you using?
from tree-sitter-c-sharp.
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:
from tree-sitter-c-sharp.
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.
from tree-sitter-c-sharp.
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...
from tree-sitter-c-sharp.
Regression introduced in #294 which also shows a lack of these use cases in the corpus tests.
from tree-sitter-c-sharp.
Should now be working correctly here - neovim-tree-sitter will need to update their reference to the latest commit on master.
from tree-sitter-c-sharp.
Thanks a lot for the swift response! I'll give it a go once they bumped up the commit in the repo.
from tree-sitter-c-sharp.
This is fixed now, thanks a lot!
from tree-sitter-c-sharp.
Related Issues (20)
- Parse error when record ends with semicolon
- Question: v0.20 release plans HOT 3
- Precedence incorrect between or and conditional access HOT 1
- C# 11 file scoped types
- C# 11 scoped ref declarations
- Can we improve the highlight groups? HOT 5
- Parsing failure in CSharp script (.csx) file with `#r` directives HOT 2
- nameof() expressions have no distinct exported tree-node, but are instead reported as invocation_expressions HOT 2
- Generic type in declaration parsed as binary expression
- Improve type parsing HOT 2
- Fix parsing UTF-16 files HOT 2
- Fix `record_base` to allow generic types and generic constructor calls HOT 3
- Add support for C# 11 unsigned right shift operator HOT 1
- Move `src/parser.c` to git LFS HOT 24
- Allow contextual keywords to be used as identifiers HOT 4
- Improve pattern parsing HOT 2
- Improve interpolated raw string literal parsing HOT 3
- Improve declaration expression parsing HOT 1
- Improve `#pragma` parsing
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tree-sitter-c-sharp.