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

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

Closed
devorrah opened this issue Aug 3, 2020 · 6 comments
Closed

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

devorrah opened this issue Aug 3, 2020 · 6 comments
Labels
in editor Relates to code editing or language features is bug
Milestone

Comments

@devorrah
Copy link

devorrah commented Aug 3, 2020

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

@DanTup
Copy link
Member

DanTup commented Aug 3, 2020

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!

@DanTup DanTup added the awaiting info Requires more information from the customer to progress label Aug 3, 2020
@jonahwilliams
Copy link

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

@DanTup DanTup added in editor Relates to code editing or language features is bug and removed awaiting info Requires more information from the customer to progress labels Aug 5, 2020
@DanTup DanTup added this to the v3.14.0 milestone Aug 5, 2020
@DanTup
Copy link
Member

DanTup commented Aug 5, 2020

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

@DanTup DanTup closed this as completed in b7ecab9 Aug 5, 2020
@DanTup
Copy link
Member

DanTup commented Aug 5, 2020

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).

@DanTup
Copy link
Member

DanTup commented Aug 5, 2020

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

@devorrah
Copy link
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
Labels
in editor Relates to code editing or language features is bug
Projects
None yet
Development

No branches or pull requests

3 participants