Skip to content

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

Closed

Description

@HadyMash

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

Activity

  1. DanTup commented on Jan 18, 2021

    @DanTup
    Member

    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.

  2. added
    awaiting infoRequires more information from the customer to progress
    on Jan 18, 2021
  3. HadyMash commented on Jan 18, 2021

    @HadyMash
    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!

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

    @DanTup
    Member

    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!

  7. 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
  8. HadyMash commented on Jan 18, 2021

    @HadyMash
    Author

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

  9. DanTup commented on Jan 19, 2021

    @DanTup
    Member

    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!

  10. akshg05 commented on Apr 2, 2021

    @akshg05

    This is still happening :(

  11. HadyMash commented on Apr 2, 2021

    @HadyMash
    Author

    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.

  12. DanTup commented on Apr 5, 2021

    @DanTup
    Member

    @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!

  13. akshg05 commented on Apr 5, 2021

    @akshg05
  14. arif-fk commented on Oct 14, 2021

    @arif-fk

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

  15. LeCongNam commented on Jul 25, 2024

    @LeCongNam

    image
    In 2024. you can enable in settings line 2

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