Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

project root != language server root #233

Open
lloiser opened this issue Sep 19, 2018 · 2 comments · May be fixed by #250
Open

project root != language server root #233

lloiser opened this issue Sep 19, 2018 · 2 comments · May be fixed by #250

Comments

@lloiser
Copy link

lloiser commented Sep 19, 2018

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:

public determineProjectPath(textEditor: TextEditor): string | null {
const filePath = textEditor.getPath();
if (filePath == null) {
return null;
}
return this._normalizedProjectPaths.find((d) => filePath.startsWith(d)) || null;
}

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

@damieng
Copy link
Contributor

damieng commented Oct 17, 2018

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)

@lloiser lloiser linked a pull request Dec 21, 2018 that will close this issue
@UziTech
Copy link

UziTech commented Oct 19, 2020

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

PR #250 has been moved to atom-community/atom-languageclient#11. We can continue discussion there.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants