atom-languageclient icon indicating copy to clipboard operation
atom-languageclient copied to clipboard

project root != language server root

Open lloiser opened this issue 7 years ago • 2 comments
trafficstars

Let's imagine several projects combined in one large git repository. Each of these projects has their own root folder in this repo. They are all related to each other so it makes sense to open them in 1 atom instance instead of opening several atom instances and switching between them.

AFAIK this is currently not supported by the AutoLanguageClient because the server always takes the atom root folder as projectPath that is then passed to the startServerProcess function.

There is already the determineProjectPath function on the ServerManager:

https://github.com/atom/atom-languageclient/blob/606faa36216657cfd8e1cea9cd2b7974e3a357ce/lib/server-manager.ts#L257-L263

If this can be overwritten by the AutoLanguageClient in some way then I think the above mentioned problem is fixed.

What do you think? I think I can prepare a PR for this.

/cc @damieng

lloiser avatar Sep 19 '18 07:09 lloiser

I've gone back and forth on this a few times - in the specific cases I can think of like TypeScript - it's quite difficult to determine what the root is. Do you go down the tree and start multiple language servers for each .tsconfig or go up the file system until you find a single one?

I think if we can come up with a technique/api that is flexible and allows for one or more language servers to start without breaking existing users that would be great (or perhaps it's always 1-to-1 and the TypeScript scenario is just an odd one)

damieng avatar Oct 17 '18 21:10 damieng

Development of atom-languageclient has officially moved to https://github.com/atom-ide-community/atom-languageclient 🎉

PR #250 has been moved to https://github.com/atom-ide-community/atom-languageclient/pull/11. We can continue discussion there.

UziTech avatar Oct 19 '20 19:10 UziTech