Skip to content

Improve VS Code's error when the Dart analyzer crashes #5328

Closed

Description

@loic-sharma

Is your feature request related to a problem? Please describe.
If the Dart analyzer crashes, VS code recommends See the output for more information:

image

However, the output pane is not helpful:

image

Describe the solution you'd like
VS Code should recommend using the Dart: Capture logs VS Code command and should link to this guide: https://dartcode.org/docs/logging/

Perhaps this should also recommend cleaning the Dart analyzer cache (deleting ~/.dartServer/ on macOS)

Describe alternatives you've considered
N/A

Additional context
N/A

Activity

  1. added
    is enhancementAn enhancement or improvement that should be listed in release notes but is not a bug fix.
    on Oct 30, 2024
  2. DanTup commented on Oct 30, 2024

    @DanTup
    Member

    There's nothing much we can currently do in this specific case, this is all functionality of the VS Code language server client:

    https://github.com/microsoft/vscode-languageserver-node/blob/ce4475fc88130e27665f49df49f162e20c328660/client/src/common/client.ts#L461

    I'll file an issue to see if we could perhaps override or contribute to this dialog though (especially as the current log output looks useless :-))

    I think deleting .dartServer probably won't fix this kind of issue frequently - most commonly this is when there is an invalid assumption on the parser (often when there is some kind of invalid code that wasn't considered).

  3. DanTup commented on Oct 30, 2024

    @DanTup
    Member

    I've opened microsoft/vscode-languageserver-node#1578 to see if we could get some more control over this.

  4. added this to the Backlog milestone on Oct 30, 2024
  5. modified the milestones: Backlog, v3.102.0 on Oct 31, 2024
  6. DanTup commented on Nov 14, 2024

    @DanTup
    Member

    Out of interest, do you know any steps to trigger it to fail in this way? Anything I try seems to result in this message that we handle ourselves:

    image

  7. loic-sharma commented on Nov 15, 2024

    @loic-sharma
    Author

    Unfortunately not. I haven't run into this issue again after clearing my Dart analyzer cache, sorry.

  8. modified the milestones: v3.102.0, On Deck on Nov 18, 2024
  9. modified the milestones: On Deck, v3.106.0 on Feb 12, 2025
  10. DanTup commented on Feb 17, 2025

    @DanTup
    Member

    I was unable to make this work as required so waiting for feedback at microsoft/vscode-languageserver-node#1578 (comment)

  11. DanTup commented on Feb 18, 2025

    @DanTup
    Member

    The default LSP prompt has now been replaced by one we control, which has "Show Log" that shows the stdout/stderr from the server, instead of "Show Output" which shows unhelpful information.

    Image

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

    is enhancementAn enhancement or improvement that should be listed in release notes but is not a bug fix.

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions