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

Flutter UI Guides not working properly in VS Code with LSP #3079

Closed
HadyMash opened this issue Jan 18, 2021 · 10 comments
Closed

Flutter UI Guides not working properly in VS Code with LSP #3079

HadyMash opened this issue Jan 18, 2021 · 10 comments
Labels
in editor Relates to code editing or language features is bug
Milestone

Comments

@HadyMash
Copy link

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:

  1. Enable the 'Preview Flutter UI Guides setting
  2. Restart VS Code
  3. Write anything that would prompt the UI Guides to show up
  4. Go to settings without changing anything
  5. 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):

  • VS Code version:
  • Dart extension version: v3.18.1
  • Dart SDK version: 2.12.0-204.0.dev
  • Flutter SDK version: 1.26.0-2.0.pre.275
@DanTup
Copy link
Member

DanTup commented 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.

@DanTup DanTup added the awaiting info Requires more information from the customer to progress label Jan 18, 2021
@HadyMash
Copy link
Author

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 DanTup added in editor Relates to code editing or language features and removed awaiting info Requires more information from the customer to progress labels Jan 18, 2021
@DanTup DanTup added this to the v3.19.0 milestone Jan 18, 2021
@DanTup
Copy link
Member

DanTup commented 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!

@DanTup DanTup changed the title Flutter UI Guides not working properly in VS Code Flutter UI Guides not working properly in VS Code with LSP Jan 18, 2021
@HadyMash
Copy link
Author

HadyMash commented 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
Copy link
Member

DanTup commented Jan 19, 2021

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!

@akshg05
Copy link

akshg05 commented Apr 2, 2021

This is still happening :(

@HadyMash
Copy link
Author

HadyMash commented 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
Copy link
Member

DanTup commented 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
Copy link

akshg05 commented Apr 5, 2021 via email

@ariffrenk
Copy link

You can try this process:--

  1. Go to settings:

  2. Enable/Check mark the 'Preview Flutter UI Guides setting

  3. Restart VS Code

I hope it worked!!

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

4 participants