Skip to content

VS Code Dart coding has strange line jumping - gif included #2696

Closed

Description

@devorrah

Hi guys, coding shifts the lines up and down. The 'Run|Debug' line appears and disappears while coding and it is giving me a headache. Does this happen to you? Is there a setting that can remedy the problem? Thanks
VSCode_Flutter_linejump

Activity

  1. DanTup commented on Aug 3, 2020

    @DanTup
    Member

    That definitely shouldn't happen. Could you capture a log (using the Dart: Capture Logs command in the command palette, untick everything except Analysis Server) while this is happening? Thanks!

  2. added
    awaiting infoRequires more information from the customer to progress
    on Aug 3, 2020
  3. jonahwilliams commented on Aug 5, 2020

    @jonahwilliams

    I've also been seeing this. A reliable way to reproduce this is to induce an analysis error in a test file (remove package:test/flutter_test import) and then make edits to the test body.

    Here are there analysis server logs when this happens: https://gist.github.com/jonahwilliams/075b4b2452093f6110f0cacd1b2e5d9a

  4. added
    in editorRelates to code editing or language features
    and removed
    awaiting infoRequires more information from the customer to progress
    on Aug 5, 2020
  5. added this to the v3.14.0 milestone on Aug 5, 2020
  6. DanTup commented on Aug 5, 2020

    @DanTup
    Member

    Thanks! I think I understand what's happening now. The issue at #2454 was caused by us processing "stale" outline notifications (eg. you type two characters, then when the outline update appears from processing the first, we have invalid offsets until the second arrives). My fix was to ignore outlines that have a different length (since we don't have version numbers). However, that's essentially telling VS Code there are no CodeLens and it will remove them.

    I think better fixes are:

    • If the length doesn't match, wait for a small period for one where the length does match rather than immediately returning none
    • For LSP, also add the document version number to the servers notification so we can do this more reliably than relying on length
  7. DanTup commented on Aug 5, 2020

    @DanTup
    Member

    I managed to repro by disabling LSP - not quite sure why it didn't occur on LSP (perhaps a timing difference due to more code running out-of-process), but I applied the fix to both.

    I'll make a build with this fix later that you can try out to ensure it's definitely fixed for you (it's quite timing dependent).

  8. DanTup commented on Aug 5, 2020

    @DanTup
    Member

    There's a preview build here that has the fix for this if you want to try it out:

    https://github.com/Dart-Code/Dart-Code/releases/tag/v3.14.0-alpha.1

  9. devorrah commented on Aug 19, 2020

    @devorrah
    Author

    There's a preview build here that has the fix for this if you want to try it out:

    https://github.com/Dart-Code/Dart-Code/releases/tag/v3.14.0-alpha.1

    thank you!

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 bug

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions