-
-
Notifications
You must be signed in to change notification settings - Fork 841
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
Dart: nvim_treesitter#indent() slow since latest dart updates #4945
Comments
Same. Also have an a delay while trying to navigate a file with |
Time to rewrite that indent, or just remove it entirely ig ... |
Can I get the file that shows the issue? Edit: Apparently not, tests file inside nvim-treesitter suffices. |
Initial opening of the file is also darn slow, which should not be related to indent ... |
There is definitely some issues with the indent module here ... 😮💨 |
I think commit 46ddea9 is the culprit. I do not observe the slowness before this commit. This comment demonstrates another way of reproducing the issue. |
This comment was marked as duplicate.
This comment was marked as duplicate.
maybe relevant UserNobody14/tree-sitter-dart#47 |
That PR has been merged; please try the new version (update nvim-treesitter, then |
This comment was marked as outdated.
This comment was marked as outdated.
The time to parse the tree is absurdly long, I don't see how parsing a 5 line file took 5.5 second
|
I concur, the last update is faster, but still quite slower than a few updates ago. By disabling
Entering insert mode with a key that triggers indent is almost as slow though:
You probably know by now but the commit that introduced this problem is 46ddea9 , so for folks that want to avoid the issue until it is fully resolved, you can lock your version at 33eb472. |
Temporary fix for issue nvim-treesitter/nvim-treesitter#4945
This comment was marked as off-topic.
This comment was marked as off-topic.
Before we do that, we need to check what that update did. If it fixed a crash or broken highlighting, this is more important than a performance regression for indents (which I remind are still experimental). |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
Not the only issue, opening new files is also extremely slow (1-2 seconds) |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
Just in case someone is doing a git bisect the following commits are good
Thanks to Lazy.nvim 's lock file |
It's so fun to try to debug this issue, even when removing For solutions, one other way to deal with it is to use revisions, such as local parser = require("nvim-treesitter.parsers").get_parser_configs()
parser.dart = {
install_info = {
url = "https://github.com/UserNobody14/tree-sitter-dart",
files = { "src/parser.c", "src/scanner.c" },
revision = "8aa8ab977647da2d4dcfb8c4726341bee26fbce4", -- The last commit before the snail speed
},
} This makes it uses the last commit that the parser is still okay For queries, of course you'd need to use an older version of it. I recommend using the queries from before #4924, and put all of |
Dart files have awful load performance due to this bug: - nvim-treesitter/nvim-treesitter#4945 Until that issue is resolved use the last known good version of nvim-treesitter. Remove 'nvim-treesitter-textobjects' plugin; I basically never used anything this plugin provided. It "may" be a source of performance problems (may), so just get rid of it until I actually need it (which may be never).
The issue fixed earlier was related to a treesitter issue. Currently locking treesitter commit 33eb472 till nvim-treesitter/nvim-treesitter#4945 is fixed.
This is not just per dart. I'm having performance issues with
|
…o delays This commit updates the treesitter setup in `treesitter-setup.lua` to address performance issues when editing Dart files. A significant delay was observed when creating new lines in Dart files, as reported in multiple issues [1][2][3]. To mitigate this, the indent and textobjects configurations for Dart have been disabled. This should prevent the editor from hanging and improve the overall user experience when working with Dart code. The commit also includes a small change where 'rust' was removed from the list of languages in `ensure_installed` to match the project's current requirements. The line was refactored for consistency. References: - [1] UserNobody14/tree-sitter-dart#48 - [2] UserNobody14/tree-sitter-dart#46 - [3] nvim-treesitter/nvim-treesitter#4945
Currently there is an issue with treesitter for Dart, which makes it extremely slow on a basic editing tasks (like inserting new line takes 1 second on my M3 Pro). Issue is tracked here: nvim-treesitter/nvim-treesitter#4945 One of the proposed solutions in the comments that worked for me is to use latest working version of treesitter: nvim-treesitter/nvim-treesitter#4945 (comment)
Describe the bug
Triggering indent (opening a file, pressing
o
orcc
, etc) takes more than one second on any dart file.To Reproduce
o
orcc
)Expected behavior
File should open quickly, and insert mode should trigger instantly.
Output of
:checkhealth nvim-treesitter
Output of
nvim --version
Additional context
Profile info:
The text was updated successfully, but these errors were encountered: