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

add raiseWindow function #208093

Open
adonovan opened this issue Mar 19, 2024 · 5 comments
Open

add raiseWindow function #208093

adonovan opened this issue Mar 19, 2024 · 5 comments
Labels
api feature-request Request for new features or functionality
Milestone

Comments

@adonovan
Copy link

adonovan commented Mar 19, 2024

Background: we maintain the Go language server (gopls). This server is both an LSP server and an integrated web server. The web server provides documentation, reports, profiles, forms, and other graphical query responses that don't easily fit into an existing LSP response. Some links in these web documents are references to source file locations. Clicking on such links causes the browser to send a request to the web server; but instead of navigating the browser to that location, the server sends an LSP showDocument downcall to the client editor, causing the editor to navigate to that location. In this manner, the client editor and the browser can ping-pong back and forward between each other, providing a richly integrated yet editor-portable user experience.

However, in the VS Code implementation of the LSP showDocument request, if the browser window is on top of the VS Code window, the editor moves its cursor and takes focus, but does not raise the window. This can make it hard to tell to the user clicking in the browser that anything happened at all. The solution is for the LSP showDocument request to raise the window (and to document this behavioral requirement). This could be done in one of several ways, including:

  1. Unconditionally raising the window when the LSP showDocument request specifies external=false and takeFocus=true. This is the simplest approach and my favored one, but perhaps raising the window is not always desirable.
  2. Adding yet another boolean field to to the LSP showDocument request indicating that the window should be raised.
  3. Raising the window only when a showDocument request is received asynchronously; that is, not during an active client-to-server LSP call initiated by a user interaction, which would imply that the editor window is already visible.

Whichever approach is decided for the LSP integration, VS Code needs to provide a function to raise the editor window. Therefore:

Proposal: we add a function, raiseWindow, that raises the current editor window.

Related: #207634

@justschen
Copy link
Contributor

tagging @dbaeumer on this I believe?

@justschen justschen assigned dbaeumer and unassigned justschen Mar 21, 2024
@dbaeumer dbaeumer removed their assignment Mar 22, 2024
@dbaeumer dbaeumer added api feature-request Request for new features or functionality labels Mar 22, 2024
@dbaeumer
Copy link
Member

Although this is described as an LSP request it has nothing to do with LSP.

The VS Code API itself doesn't provide any API to raise a Window.

@VSCodeTriageBot VSCodeTriageBot added this to the Backlog Candidates milestone Mar 22, 2024
@VSCodeTriageBot
Copy link
Collaborator

This feature request is now a candidate for our backlog. The community has 60 days to upvote the issue. If it receives 20 upvotes we will move it to our backlog. If not, we will close it. To learn more about how we handle feature requests, please see our documentation.

Happy Coding!

@VSCodeTriageBot
Copy link
Collaborator

This feature request has not yet received the 20 community upvotes it takes to make to our backlog. 10 days to go. To learn more about how we handle feature requests, please see our documentation.

Happy Coding!

@VSCodeTriageBot
Copy link
Collaborator

🙂 This feature request received a sufficient number of community upvotes and we moved it to our backlog. To learn more about how we handle feature requests, please see our documentation.

Happy Coding!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api feature-request Request for new features or functionality
Projects
None yet
Development

No branches or pull requests

4 participants