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
Flutter UI Guides not working properly in VS Code with LSP #3079
Describe the bug
I have an issue with flutter and visual studio code were the UI Guides don't show when I am writing my code but only show when I go to another file and then go back to the file I was editing. I have the Preview Flutter UI Guides setting on and have tried toggling the Custom Tracking and the problem is still not fixed. I also tried it on a MacOS machine and a Windows machine and the same unexpected behaviour happens. Please let me know if you need anything such as screenshots, screen recordings or any other info.
To Reproduce
Steps to reproduce the behavior:
Enable the 'Preview Flutter UI Guides setting
Restart VS Code
Write anything that would prompt the UI Guides to show up
Go to settings without changing anything
Go back the file you were editing
Screen recording
Please feel free to skim through the video. What the video shows is that the UI Guides don't show on saving or typing but only show when I go to the settings, then back to the document. They even show if I don't save the document but go to the settings page then back.
Expected behavior
Similar to the behaviour in android studio, the UI guides should show up in the same window when I type the line, save, etc. I have format on type and format on save on and the issue still occurs.
Versions (please complete the following information):
Does this still occur if you enable the "LSP Preview" setting? The LSP version will soon become default so if it doesn't happen there, it will be fixed once we move over.
The LSP setting switches the protocol used to talk to the language server (which provides all of the analysis and language functionality). This might be affecting the timing of startup, or there might be some subtle differences in handling the outlines used to draw these lines - I'll see if I can track it down.
LSP will become default in the future (and eventually the only option), so if that's where the bug is it'll need to be fixed. Thanks!
changed the title [-]Flutter UI Guides not working properly in VS Code[/-][+]Flutter UI Guides not working properly in VS Code with LSP[/+]on Jan 18, 2021
Thanks!
I also noticed another issue. A friend of mine also had the same issue and he also had LSP on. After he turned it off, it worked perfectly.
However, when we joined a Live Share session, they didn't appear for him. He left the session and they appeared again. So then I tried joining his live share session and it didn't work. Should I mark this as a new issue or is it fine being here?
However, when we joined a Live Share session, they didn't appear for him. He left the session and they appeared again. So then I tried joining his live share session and it didn't work. Should I mark this as a new issue or is it fine being here?
It's probably the same issue. The issue was that the previews were not being updated correctly if the analysis results (the "Flutter outline" data) arrived while the file was already open because of a bad comparison between filenames/URIs.
I've pushed a fix - though if the issue still occurs once the next release goes out (likely around the end of the month), then do file a new issue to be looked at. Thanks!
Hello @akshg05,
The problem was fixed for me with the update released after this post. Make sure that VS Code and the Dart Code extension are up to date, that might fix the problem.
Activity
DanTup commentedon Jan 18, 2021
Does this still occur if you enable the "LSP Preview" setting? The LSP version will soon become default so if it doesn't happen there, it will be fixed once we move over.
HadyMash commentedon Jan 18, 2021
The "LSP Preview" setting is on. I tried turning it off and it worked perfectly. Might I know what the LSP setting does?
Many thanks!
DanTup commentedon Jan 18, 2021
The LSP setting switches the protocol used to talk to the language server (which provides all of the analysis and language functionality). This might be affecting the timing of startup, or there might be some subtle differences in handling the outlines used to draw these lines - I'll see if I can track it down.
LSP will become default in the future (and eventually the only option), so if that's where the bug is it'll need to be fixed. Thanks!
[-]Flutter UI Guides not working properly in VS Code[/-][+]Flutter UI Guides not working properly in VS Code with LSP[/+]HadyMash commentedon Jan 18, 2021
Thanks!
I also noticed another issue. A friend of mine also had the same issue and he also had LSP on. After he turned it off, it worked perfectly.
However, when we joined a Live Share session, they didn't appear for him. He left the session and they appeared again. So then I tried joining his live share session and it didn't work. Should I mark this as a new issue or is it fine being here?
Many thanks!!
DanTup commentedon Jan 19, 2021
It's probably the same issue. The issue was that the previews were not being updated correctly if the analysis results (the "Flutter outline" data) arrived while the file was already open because of a bad comparison between filenames/URIs.
I've pushed a fix - though if the issue still occurs once the next release goes out (likely around the end of the month), then do file a new issue to be looked at. Thanks!
akshg05 commentedon Apr 2, 2021
This is still happening :(
HadyMash commentedon Apr 2, 2021
Hello @akshg05,
The problem was fixed for me with the update released after this post. Make sure that VS Code and the Dart Code extension are up to date, that might fix the problem.
DanTup commentedon Apr 5, 2021
@akshg05 if you're still seeing issues on the latest versions of everything, please file a new issue with details and I'll take a look. Thanks!
akshg05 commentedon Apr 5, 2021
arif-fk commentedon Oct 14, 2021
You can try this process:--
Go to settings:
Enable/Check mark the 'Preview Flutter UI Guides setting
Restart VS Code
I hope it worked!!
LeCongNam commentedon Jul 25, 2024
In 2024. you can enable in settings line 2