-
Notifications
You must be signed in to change notification settings - Fork 823
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
Feature request: Server initiated "window/showTextDocument" notification #612
Comments
Makes sense to me. @rasika would you be will on working on a PR for this. I can assist and there is a guideline on how to do this: https://github.com/Microsoft/language-server-protocol/blob/master/contributing.md I would make it a request to be able to return an indication if the opening was successful or failed. |
@dbaeumer Thanks for the info. Sure, I'll proceed with the PR. |
@rasika just to clarify. We need a PR here and in https://github.com/Microsoft/vscode-languageserver-node since at least one implementation is necessary as well. |
Would it make sense to send an array so that you can open multiple files or just send multiple requests? |
I am fine sending an array. |
@rcjsuen +1 for the array. Will implement accordingly. |
I am personally not a huge fan of serve-initiated requests to change the state of the client, because they break the causality: you can't reliably infer what was the cause of the request. I'd rather we add an ability to focus specific document when applying edits. @rasika would it work for your if @dbaeumer I would also appreciate an ability to focus a specific position after a document edit, and a specific document after workspace edit. In my rust-server, I use a bespoke implementation of edits to have this feature. I need it in two cases:
|
@dbaeumer sorry couldn't track this thread after the vacation. Apparently can implement as a Request. Will start working on it today. |
@rasika could you clarify if you need a completely separate request to show arbitrary text document, or if you have a more specific requirement of "open a text document after creating it using |
Replied to #663; adding a comment here for the future reference. |
@rasika any news on the PR? |
Since @rasika didn't answer I decided to give it a try: microsoft/vscode-languageserver-node#490 You're gonna use it this way: await connection
.sendRequest(ShowTextDocumentRequest.type.method, {
fileName,
options: {
selection,
}) I just implemented it for the node server without making any protocol proposal, because I'd like to discuss it little bit to see if there is anything that you would like to change before. |
Apology for the late reply. Please go ahead. Won't be able to actively contribute due to recent workload spike in my day job. |
I just signed the CLA, let me know if there is anything else I can do to get such feature merged. We rely on it to release the next version of the graphql-for-vscode extension. |
The actual client capability does not appear to have been added. |
It happened again, so I've just opened a PR #1138 instead of posting another comment in another closed issue. |
@KamasamaK thanks. Merged the PR. |
I would like to request a feature which is a server-initiated notification
window/showTextDocument
to open and/or show text document with a given Location.Propose Change
Location
defined as follows:Why?
This is beneficial when text files are generated by the Server and wants clients to open / show the text document(optionally to focus specific position) in cases such as test files generation, stubs generation.
I am already aware of the
CreateFile
andCreateFileOptions
still it won't allow to focus on specific position for a Server initiated notification(please correct me if I am wrong here).WDYT?
The text was updated successfully, but these errors were encountered: