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

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

Closed
ronba opened this issue Apr 29, 2022 · 4 comments
Closed

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

ronba opened this issue Apr 29, 2022 · 4 comments
Labels
in editor Relates to code editing or language features is bug
Milestone

Comments

@ronba
Copy link

ronba commented Apr 29, 2022

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
@ronba ronba added the is bug label Apr 29, 2022
@DanTup
Copy link
Member

DanTup commented Apr 29, 2022

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?

@DanTup DanTup added this to the v3.42.0 milestone Apr 29, 2022
@DanTup DanTup added the in editor Relates to code editing or language features label Apr 29, 2022
@ronba
Copy link
Author

ronba commented Apr 29, 2022

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.

@DanTup
Copy link
Member

DanTup commented May 3, 2022

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.

@DanTup
Copy link
Member

DanTup commented May 26, 2022

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

@DanTup DanTup closed this as completed May 26, 2022
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

2 participants