akinsho / flutter-tools.nvim

Tools to help create flutter apps in neovim using the native lsp
MIT License
935 stars 75 forks source link

[BUG] Insane delay after pressing enter #298

Closed throwaway-squared closed 8 months ago

throwaway-squared commented 8 months ago

Is there an existing issue for this?

Current Behavior

ive seen only one guy describe the same issue

when i press enter to get a new line in insert mode, it takes a good few seconds before nvim catches up and actually draws to the screen, although my input is still read and i can still type whats supposed to be in the next line, it just takes a while to actually show it

this only happens when flutter-tools is running (ive only tested it on the lib/main.dart file)

Expected Behavior

upon pressing enter, a new line should be created without a delay of drawing it to the screen

Steps To Reproduce

  1. have my configuration (idk if this happens with other configs)
  2. open a dart file (mainly lib/main.dart in a flutter project)
  3. type some code
  4. press enter should be noted that it seems to appear more often when splitting brackets in this manner] (| is the cursor):
    1. appBar: AppBar(|)
    2. press enter

Environment

Markdown

Anything else?

No response

gradunza5 commented 8 months ago

For whatever it's worth, I'm having this issue as well, and only with dartls. Other language servers I'm using (C#, lua, markdown, some others) don't show this issue. I haven't been able to find anything else on the internet about it.

koga25 commented 8 months ago

From what i searched, the problem is with dart treesitter when it idents something. When i was searching about this i found two temporary solutions that worked for others:

Removing dart treesitter Disabling dart treesitter ident

I don't know if this will help you, but it doesn't hurt to try.

akinsho commented 8 months ago

This plugin isn't responsible for all things dart/flutter related in neovim, only the language server for the most part and setting it up with extensions. I can't reproduce this issue and the issue itself doesn't contain a minimal reproduction without a bunch of other plugins/logic. I think the links above are the most likely culprit. If someone is able to directly tie this to something specific this plugin is doing please post here and I'll re-open otherwise I don't think this issue is truly here.

maobai405 commented 8 months ago

https://github.com/nvim-treesitter/nvim-treesitter/issues/4945#issuecomment-1691168369