-
Notifications
You must be signed in to change notification settings - Fork 32
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
feat(treesitter): no longer depends on nvim-treesitter #151
Open
ofseed
wants to merge
1
commit into
kevinhwang91:main
Choose a base branch
from
ofseed:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without
nvim-treesitter
, we can't decide whether the buffer of lang should render, so the condition may be meanless.highlighter.active[bufnr]
checks whether the target buffer is rendered by treesitter or not, it is incorrect to use it here.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only way to enable treesitter highlighting is
vim.treesitter.start
in the future,nvim-treesitter
will no longer needed, the config module is removed in the experimental branch, see https://github.com/nvim-treesitter/nvim-treesitter/tree/main.In the meantime, it is supported in neovim 0.10 now, now
c
,lua
, andvim
parsers and corresponding queries are bundled within neovim distribution, so everyone has treesitter bundled and highlight enabled for lua, see https://github.com/neovim/neovim/blob/5931f780e0282ad486fa070bb05b3877cc1d44f0/runtime/ftplugin/lua.lua#L2nvim-treesitter
will only provide extra parsers and queries in the experimentalmain
branch and the future 1.0 release.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First, we need a prediction to decide whether the buffer of lang should render,
highlighter.active[bufnr]
is a state here, not a prediction. Withoutnvim-treesitter
, passby this condition. If you have any ideas for prediction, write it to code directly.Second, we must keep the original
configs.is_enabled
fornvim-treesitter
.