Skip to content

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

Closed

Description

@ftzi

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!

Activity

  1. DanTup commented on Sep 30, 2019

    @DanTup
    Member

    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.

  2. added this to the v3.6.0 milestone on Sep 30, 2019
  3. added
    in editorRelates to code editing or language features
    is enhancementAn enhancement or improvement that should be listed in release notes but is not a bug fix.
    on Sep 30, 2019
  4. DanTup commented on Oct 9, 2019

    @DanTup
    Member

    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.

  5. irahulcse commented on Nov 6, 2019

    @irahulcse

    Thanks, @DanTup. This update was really helpful.

  6. DanTup commented on Nov 6, 2019

    @DanTup
    Member

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    in editorRelates to code editing or language featuresis enhancementAn enhancement or improvement that should be listed in release notes but is not a bug fix.

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions