Skip to content
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

fix(treesitter): manually trigger parsing #1713

Merged
merged 1 commit into from
Dec 18, 2023

Conversation

xiyaowong
Copy link
Collaborator

issue #1700

This is a common use case, and "treesitter-objects" is useful. (Note: I haven't explored why treesitter doesn't automatically parse after text changes.)

@theol0403
Copy link
Member

This bug has been bothering me for a long time but it seemed too strange to make an issue for.

Ideally we figure out why it's not working... but it makes no sense to me. Operations like undo all happen on the nvim side.

@xiyaowong
Copy link
Collaborator Author

xiyaowong commented Dec 18, 2023

but it makes no sense to me.

🙋‍♂️I added a todo. It could be a simple bug for someone familiar with nvim-treesitter. Let’s wait for someone interested to contribute.

@theol0403 theol0403 merged commit c2ca1be into vscode-neovim:master Dec 18, 2023
7 of 8 checks passed
@theol0403
Copy link
Member

Actually I just tested this, and I can still reproduce if I undo and execute rapidly. Is there a way of removing the timer and making it triggered automatically? If not, we should maybe speed up the timer.

@xiyaowong
Copy link
Collaborator Author

rapidly

In most cases, it wouldn't be so fast... You can adjust the time down without any impact. I copied it directly from my config. I try to reduce unnecessary operations as much as possible based on my own needs

@xiyaowong
Copy link
Collaborator Author

xiyaowong commented Dec 18, 2023

Actually one line is enough 👀 :

au TextChanged * silent! lua vim.treesitter.get_parser():parse()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants