-
Notifications
You must be signed in to change notification settings - Fork 401
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
Support of several maven projects in the single workspace #311
Comments
jdt.ls expects https://github.com/Microsoft/language-server-protocol/blob/master/protocol.md#initialize to be called once with a root uri, from which the projects are discovered At the moment though, we're not discovering new projects after that initial initialization call, see #144. Can you give us more details about your initialization process? How are your projects organized? |
The setting is one workspace that contains several projects. Each project is an independent reactor. Currently LSP should be restarted whenever wanting to get language services for another project in the workspace. |
Ok so this one is tricky. vscode is introducing the concept of multiple root workspaces so we'll have to figure out how to cope with that in jdt.ls. One basic solution could be to run an instance of jdt.ls per root folder, but you couldn't have workspace resolution between modules of different reactors in the same workspace. Alternatively, running a single jdt.ls instance for multiple root folders would save on used resources and provide global workspace resolution but that could also be seen as reactors leaking modules to one another. Still, that's the way Eclipse works so it's probably ok. @aeschli any advice? |
It would be great if we can support multiple root folders by looking for projects in all of them. |
Do you have any idea how other implementations of the LSP (for other languages) treat several projects in a workspace? |
We probably should have one language server per workspace. I presume the reason for collecting multiple root folders to a workspace is that they are somewhat related and a language server should follow suit. I think we need extensions to LSP to properly support this. Filed microsoft/language-server-protocol#281 to follow up. |
IMO we should try to avoid multiple servers for the following reasons:
I don't see any real issues with sharing the same Eclipse workspace for all root folders. Some challenges:
|
@amiramw We try to encourage all language server try to add support so that multiple roots can be supported by the same server. For most languages that works well. The only language I'm aware right now which conclused they need a server per folder approach is C++. |
Personally, I would prefer that "initialize" will refer Workspace root and project type specific functions like build and Symbol table initial building will be triggered by "didOpen" of project meta files like pom.xml, package.json, etc. |
Sorry, closed by mistake |
Now that we have multi-root workspaces fully supported is there anything else left here to do ? @fbricon |
@gorkem how it works? run in the root directory? |
SAP WebIDE supports workspaces with several maven projects. It causes the situation when initialize is sent for every open project in the workspace to trigger maven build and indexing. Although it doesn't cause any reported error, almost all LSP functions work only for the 1st opened project. Is it limitation caused by LSP implementation or by JDT? In the eclipse IDE environment JDT successfuly serves such configuration.
The text was updated successfully, but these errors were encountered: