-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug: failed to parse :host pseudo class #61
Comments
/cc @amaanq , :host is really critical to css spec! |
Hey @jordimarimon are you going to open a PR with your change jordimarimon@2b7ecb8 ? /cc @amaanq |
Sorry for the late response @mohamedmansour, I didn't create a pull request because I wasn't quite sure that my approach for fixing the issue would be the best. What I have done is make I don't see it as a bad thing as I'm using treesitter inside neovim and in my case is for syntax highlighting, so I prefer the grammar to accept invalid CSS also, as this way when I'm in the middle of writting something, the AST doesn't have errors and the highlighting looks fine. If it's okay for the maintainers of this grammar what I have done, I can open a pull request! |
@amaanq CSS :host parameter is more broken than before now, can we merge @jordimarimon PR in? Would love to maybe contribute to this repo as well since treesitter CSS needs better syntax support in Zed @maxbrunsfeld |
@jordimarimon can you please open the PR? And we can see how it goes |
@jordimarimon I tested your change and I am getting error, unless I am loading it wrong |
Ah it does work @jordimarimon I had to run |
Did you check existing issues?
Tree-Sitter CLI Version, if relevant (output of
tree-sitter --version
)No response
Describe the bug
I have installed the latest version of the parser (commit hash:
6a442a3cf461b0ce275339e5afa178693484c927
)When using the
:host
pseudo class without arguments, I get errors in the parsed tree.https://developer.mozilla.org/en-US/docs/Web/CSS/:host
Steps To Reproduce/Bad Parse Tree
The following fails to parse:
This is the AST that I get when I use the
InspectTree
command in neovim:If I write the following:
It parses correctly.
Expected Behavior/Parse Tree
It's valid to write the
:host
pseudo class without arguments.I don't have a lot of knowledge about writing grammars with tree-sitter but I suspect that this line may be the one causing the conflict:
tree-sitter-css/grammar.js
Line 183 in 6a442a3
Repro
The text was updated successfully, but these errors were encountered: