-
Notifications
You must be signed in to change notification settings - Fork 799
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
Protocol extension to support workspace folders. #298
Comments
Seems like a sensible addition. Will this be targeting 4.0? |
@david-driscoll since it is no breaking and the capability is flagged by the client and by default false I think we can add this to a 3.x version. Implementations are available in the vscode-language* npm modules. But you have to opt into them. |
See here on how to contribute new protocol: https://github.com/Microsoft/language-server-protocol/blob/master/contributing.md |
If I am reading the documentation correctly, then if a client supports multiple workspaces, then it will announce that support during the init. But there still will only be one In my implementation, I am immediately responding to the initialization request, and do some background processing to start churning the code in the initial I am imagining that if the client says that it supports multiple workspaces, I would like to know what those workspaces are immediately, so that I can add that to my background processing. I'd like to know if there's any (theoretical) issues if I send a |
I understood, that the list of The |
@svenefftinge is correct. The list of folders comes in the initialize request as well. |
That's awesome, and will keep my startup code more simple. Thanks @svenefftinge and @dbaeumer . |
I don't see a serverCapability associated with the support for multiple folders in the proposal. Then, if the client supports multiple folders and initialize with this request capability, how can the client know whether the server can support multiple folders to decide whether to reuse it across multiple projects or to spawn a new instance for each project? |
About previous comment, in the proposal, it introduces a capability to register. While this can be useful in many case, registering capabilities is an overhead in the flow, and we could expect the support for modifiable multiple root folders to be declared as a ServerCapability. |
See microsoft/vscode-languageserver-node#272 for a proposal to support it in ServerCapabilities as well. |
@mickaelistria having this server capability makes sense. Can you please sign the CLA otherwise I can't merge it. |
@dbauemer I signed CLA earlier today and the bot says "all CLA are met". Anything else I'm missing? |
Nothing else. It still has the CLA required label but I will remove it. |
Thank you!
Another question: is it safe to assume (and specify) that in case server
supports multi-folders, rootUri isn't expected to be used by server?
…--
Mickael Istria
Eclipse IDE <https://www.eclipse.org/downloads/eclipse-packages/>
developer, at Red Hat Developers <https://developers.redhat.com/> community
Elected Committer Representative at the Eclipse Foundation
<https://www.eclipse.org/org/> board of directors
|
Yes that is correct. |
The structure looks a little different to support future growth of the properties:
|
A suggestion: can we call it |
@keegancsmith The initialize paramater uses This has been like this since the first commit. Anything I miss. |
Sorry for the confusion, I was referring to the existing |
I don't think that being consistent with Visual Studio Code should necessarily have a bearing on what is ultimately picked as a name here. The point of the language server protocol is to be client agnostic. Also note that while VS Code may call them folders in the user interface, the feature itself is advertised as "multi root workspaces". |
|
For the capability, do we expect it to be |
It is |
What is a relation between |
@dbaeumer Is this complete? It's in the spec like it is, but this issue is still Open. Btw - there may be some bad text in the spec for this:
The "it first" at the end doesn't make sense to me (maybe it should be "at first" or the word "it" removed, though I'm still not sure what it means. |
@krzyzanowskim if more than one workpace folder is provided there is no @DanTup thanks for pointing out the incomplete sentence. Fixed it. I will close the issue since this is indeed implemented. |
@dbaeumer one more question. Who's responsibility is to close an open document for a removed folder. I guess the client should notify the server, and close the files from the folder that is about to be removed. Thoughts? |
As I understand it, it's fine to have open files outside of the the open folders so I don't think these two things are related. If an editor chooses to close files when a workspace folder is removed, it should send events for them. If it does not, the server shouldn't make any assumptions about them being closed. |
@krzyzanowskim @DanTup is correct. It depends on what the editor decides to do. |
Many tools support more than one root folder per workspace. Examples for this are VS Code's multi-root support, Atom's project folder support or Sublime's project support. If a client workspace consists of multiple roots then a server typically needs to know about this. The protocol up to know assumes one root folder which is announce to the server by the
rootUri
property of theInitializeParams
. A protocol extension is proposed to add first class workspace folder support. A markdown documentation is here and a reference implementation for the client and serverThe text was updated successfully, but these errors were encountered: