-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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
LSP window/showDocument{external=false, takeFocus=true} does not raise the editor window #207634
Comments
Thanks for creating this issue! It looks like you may be using an old version of VS Code, the latest stable release is 1.87.2. Please try upgrading to the latest version and checking whether this issue remains. Happy Coding! |
Actually I also tested this with pure VS Code API and it has the same behviour. I will close the issue since it IMO works as expected. |
I wonder what is the value of taking focus if the editor window is not visible; and what is the cost of raising the window when responding to a showDocument request. |
An alternative: If changing the default behavior of showDocument is unacceptable (is it?), could we add a |
It gives focus so that when you bring the window to front the editor has the focus.
Before adding such a API to LSP we would need it in VS Code first. So I suggest to create a new issue requesting such a feature in the VS Code API and we take it from there. |
It's particularly when the showDocument request arrives outside of the context of an active client-to-server call that raising the window becomes necessary; for all other showDocument requests we can rely on the editor being visible since the user must have just interacted with it. (BTW, we've been thinking of using this kind of out-of-band browser request as a means to portably prototype refactorings
Thanks for the advice; will do. |
Does this issue occur when all extensions are disabled?: Yes
Steps to Reproduce:
Why do I care?, you might ask. We (the maintainers of the Go LSP server) are using a web server within our LSP server to display reports in response to certain queries initiated by the editor via a Code Action. A report might be rendered documentation for the current package, for example, or a rendered CPU profile. The reports contain links to the source code, that, when clicked, cause the LSP server to send an asynchronous showDocument downcall to the editor, causing it to open the designated source location. This enables very rich interactions between the editor and the browser.
The text was updated successfully, but these errors were encountered: