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

Is there any way to speed up the "auto closing brackets comments" updates? #2011

Closed
SrBrahma opened this issue Sep 19, 2019 · 4 comments
Closed
Labels
in editor Relates to code editing or language features is enhancement
Milestone

Comments

@SrBrahma
Copy link

It takes like 1-2 seconds here to update the auto comments, and it really takes my attetion from the code, and quite botters me.

Is there anyway to decrease the delay?

Thanks!

@DanTup
Copy link
Member

DanTup commented Sep 30, 2019

We have a half-second delay when we get updates to the data that renders these, because if you're typing quickly we might get an update that corresponds to an older version of the document - and if we render that, all of the offsets would be incorrect and they'd render in the wrong locations.

It's possible we might be able to improve this, for example:

  1. Doing some basic checking on the offsets to see if they correspond to locations that look sensible (eg. parens)
  2. If we move to the LSP implementation, we might be able to attach document versions to the data, so we could immediately use or discard the results

2 is long-term, but maybe 1 is more feasible in the sort term. I'll see if I can have a little play with this when time allows.

@DanTup DanTup added this to the v3.6.0 milestone Sep 30, 2019
@DanTup DanTup added in editor Relates to code editing or language features is enhancement labels Sep 30, 2019
@DanTup DanTup closed this as completed in bc1f31b Oct 9, 2019
@DanTup
Copy link
Member

DanTup commented Oct 9, 2019

I've removed the 500ms delay when processing the labels now, but instead check that each one matches up with a ) or ] in the document before updating. This should make them update much quicker (and remaining delay is in the round trip to the server, but has been tiny in my testing).

If you want to try it out, there's a build here:

https://github.com/Dart-Code/Dart-Code/releases/tag/v3.6.0-alpha.2

More info on installing from vsix is here: https://dartcode.org/docs/installing-a-preview-release/

Please let me know how it feels.

@irahulcse
Copy link

Thanks, @DanTup. This update was really helpful.

@DanTup
Copy link
Member

DanTup commented Nov 6, 2019

Great, glad to hear it's better! 👍

(FWIW if it wasn't clear, the version linked above has now been released, so you don't need to install the preview, you can just get 3.6 from the marketplace).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in editor Relates to code editing or language features is enhancement
Projects
None yet
Development

No branches or pull requests

3 participants