eclipse-jdtls / eclipse.jdt.ls

Java language server
1.79k stars 399 forks source link

Single JDTLS instance to support multiple projects / workspaces #2630

Open asmodeus812 opened 1 year ago

asmodeus812 commented 1 year ago

Hi, i have been looking around for this in jdtls, not sure if it is supported, but it would be great if we could have only one single instance running which can detect and attach to multiple unique workspaces / root directories. At the moment as i see the data folder is coupled with the project jdt is started with/for. Not sure if jdtls even supports workspace/didChangeWorkspaceFolders, also the data folder should support change on the fly similary to how we can modify the server settings with didChangeConfiguration (for example)

As it is now, having even 4 to 5 projects open means that we have to spawn a new instance for each, which has an insane impact on system resources, and there is no reason for a language server to store state based on / wihin the actual instance instead of on the file system. Most (pretty much) all language servers are single instance, and do support many unique projects/workspace directories.

asmodeus812 commented 1 year ago

Any feedback on that one ? Is it already supported or planned to be in the future, thanks !

lbrayner commented 10 months ago

@asmodeus812 jdtls supports multiple workspace folders, but it's still a single project. That is, you share settings such as the runtime. Currently a workspace folder is not on pair with an Eclipse project, but it's OK if you can bear to share some settings.