You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
VS Code Dart coding has strange line jumping - gif included #2696
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
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!
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.
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
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).
Activity
DanTup commentedon 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!
jonahwilliams commentedon Aug 5, 2020
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 commentedon 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:
DanTup commentedon 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 commentedon 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 commentedon Aug 19, 2020
thank you!