-
Notifications
You must be signed in to change notification settings - Fork 27
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
tree-sitter-scss nodes parsed as ERROR only in vue #10
Comments
Ah I got the culprit. You can't have both css and scss parsers installed or else the above parse errors happen. Looks like the css parser always takes precedence over scss, even if lang="scss" I don't understand .scm files, but I guess this code hints that this could be it. Repro script: # recurse submodules because need to downloads nvim-treesitter repos
git clone --recurse-submodules https://github.com/3nuc/tree-sitter-vue-issue-10
# this just contains running neovim to open index.vue file
# with just the plugins from the repo (not your local ones)
./run.sh
#after tree-sitter runs the ensure_installed parsers (vue, scss), close nvim and repoen it
:qa!
./run.sh
# the default theme doesn't really show parse errors in syntax highlighting so open TS Playground to make sure
:TSPlaygroundToggle
# you should get no parse errors, because the "css" parser is not installed. let's install it now
:TSInstall css
#re-parse the current file with both scss and css (index.vue)
:e!
#toggle the query playground because it's still showing data from when "css" parser was not installed
:TSPlaygroundToggle #closes
:TSPlaygroundToggle #reopens
#Now you should have the parse errors that I have screened in the OP |
Hi, can you follow the steps from #8 (comment) to reproduce the issue? As a side note, |
Nope I can't. I'll reopen in nvim-treesitter. Thanks! *If someone comes across this issue in the future - run |
Recently, a scss parser was added to nvim-treesitter:
Also see the PR that added
tree-sitter-scss
to nvim-treesitter: https://github.com/nvim-treesitter/nvim-treesitter/pull/1109/filestree-sitter-scss
highlights .scss files fine, but if you paste the very same contents of that .scss file into a.vue
<style lang="scss">
tag, this happens:top half: .scss file - left is query info, right is the source code itself
bottom half: .vue file - left is query info, right is the source code
The syntax highlighting starts breaking whenever you use the keywords "and" or "or", even if they're part of a variable name:
eg.
$my-color: red;
- sincecolor
containsor
, the highlighting breaks. But that happens only in .vue files. .scss files are ok.People originally started reporting parsing issues since this comment: nvim-treesitter/nvim-treesitter#650 (comment)
(query info thanks to https://github.com/nvim-treesitter/playground)
System info:
treesitter healthcheck
nvim verison
Plugin versions:
nvim-treesitter a0e99abd7c4485d4da34e8f57fb930fe1dbaa93c
Parser versions:
tree-sitter-vue 91fe275
tree-sitter-scss b2407613f3804d0db15ae6f9f49cf2e759f06dba
The text was updated successfully, but these errors were encountered: