eclipselabs/eclipse-language-service

Multi-project support

Closed this issue · 2 comments

At the moment, the implementation supports a language server per project, via ProjectSpecificLanguageServerWrapper. I wonder what are your thoughts about how it would work if we would want to use one server per workspace.

The simple solution would be to initialize its root with the workspace location, but projects need not be physically placed in the workspace (and also there are things like linked resources) and I'm not sure if that will work well. On the other hand, if the DidChangeWatchedFiles method is called by an Eclipse resource change watcher, then it might not be a problem.

What should be the root location for the language server, passed to setRootPath on initialize, is not clearly specified. Some language server seem to not care about it (JSON) some others (OmniSharp) require it to be a path containing the proejct metadata (project.json IIRC for C#). At the moment, the relationship that seems to map the most properly Eclipse workflows is to have LSP Workspace <-> Eclipse project.
But we may imagine finding some metadata on a project and a language server to dynamically compute what's the best root path for a given server. However, at the moment, I'm not sure there is enough "state of the art" to implement this in a sustainable way.

I understand. So if I want to try to support multiple projects, I'll have to implement a WorkspaceSpecificLanguageServerWrapper myself.

The thing is that I'm implementing the server at the same time, and it's easy to make it incompatible with other servers, so I try to keep track of what might break things. It would be best if there was a clear way to extend the LS without confusing clients that don't understand the extensions.