Skip to content

Output pane auto-focused on workspace/executeCommand failures #3946

Closed

Description

@ronba

Describe the bug
The VSCode output pane is focused automatically whenever workspace/executeCommand fails.
This is similar to #2280.

To Reproduce
Steps to reproduce the behavior:

  1. Move the Output pane to the sidebar or anywhere else where it is out of focus and switch to a different tab.
  2. Create a dart file with an error that would trigger the 'Go to output' notification. For example, this content would work:
class SomeClass {
}
}
  1. Now when saving the file a dialog like the below should pop up.
    image

At the same time the output pane automatically gets focused - without pressing "Go to output".

Expected behavior
The output pane should only become focused if 'Go to output' is clicked.

Analysis
Looking at the code bundled with the Dart-Code extension - I think the reason is the following change: microsoft/vscode-languageserver-node@a1d9d1a which was made available in version 8 of the language client (while it looks like the extension is still using 7?

Workaround
For now I've just been patching the Dart-Code extension manually :)

Please complete the following information:

  • Dart extension version: v3.39.20220411
  • Dart/Flutter SDK version: 2.10.5

Activity

  1. DanTup commented on Apr 29, 2022

    @DanTup
    Member

    I think the reason is the following change: microsoft/vscode-languageserver-node@a1d9d1a which was made available in version 8 of the language client (while it looks like the extension is still using 7?

    You're right - the next version has not been published as a stable release yet, but I'm expecting it in the coming weeks (it forms part of the LSP 3.17 release). I'll keep this issue open until that's done.

    Although, generally I would hope that this message does not pop up very often, as it means something has failed on the server. You mention creating a file with invalid Dart code and pressing Save, but that certainly should not ordinarily trigger this issue. Are you perhaps running some code actions on-save that require valid files?

  2. added this to the v3.42.0 milestone on Apr 29, 2022
  3. added
    in editorRelates to code editing or language features
    on Apr 29, 2022
  4. ronba commented on Apr 29, 2022

    @ronba
    Author

    Thanks for the quick reply @DanTup - sounds good! For now I'm just using a tiny patch for the extension code which looks like this:

    33171c33171
    <             this.outputChannel.show(true);
    ---
    >             this.outputChannel.show(items.includes('Go to output'));
    

    Based on my output logs the setting that most commonly triggers the popup is "source.sortMembers": true, as I manually save my files frequently while working on them.

  5. DanTup commented on May 3, 2022

    @DanTup
    Member

    Ah, thanks for confirming. I think we can handle the error there now (so we fail silently when it's invoked automatically). I've filed #3950 about that and will keep this open to test the other issue after updating the LSP client.

  6. DanTup commented on May 26, 2022

    @DanTup
    Member

    We're now using v8 of the LSP client (fc16c6b).

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