-
Hi, and thanks for this awesome project! I'm a complete emacs-lsp newbie (since about 2 days ago), despite having used emacs since 1994, but am excited to learn more about it! I have quite a few questions. I've tried to find answers in the docs, but am struggling so far. If people can help me understand then maybe I can submit some PRs to try to clarify these topics and make them easier for the next newbies who arrive :-) WorkspacesWhat are workspaces in emacs-lsp, exactly? I can't find them defined in the documentation. Does "workspace" refer to the same concept in VS Code? In other words (if I understand correctly), a workspace is a group of "folders", where a folder is a bit like a project in In which case, is there any equivalent to workspaces in emacs? I'm not aware of any way to group projectile projects together, or do anything similar. This leads onto other related questions:
I do appreciate that LSP was originally designed for VS Code, which would result in VS Code terminology like "folders" and "workspaces" making its way into LSP design, and from there into emacs-lsp. But IMHO it would be really helpful to have a clear explanation of how this terminology maps to emacs. Multi-root language serversI'm also trying to understand the multi-root concept. Presumably "multi-root language servers" refers to servers which somehow support "multi-root workspaces"? But as per 2. above, it's not clear what multi-root workspaces would map to in emacs. Does it mean that each workspace (or the only workspace?) can have one language server (or maybe more?), but each language server can keep track of multiple projects independently, each with its own root directory and own compilation environments, e.g. so that a Javascript module available in one of the roots would not automatically be available in another? I saw the question in the FAQ "How do I force lsp-mode to forget the workspace folders for multi root servers so the workspace folders are added on demand?" but I didn't really understand the question. In what scenario would you want to forget workspace folders, and what does "added on demand" mean? Thanks a lot for any light you can shed on any of these questions! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
When I started working on
It is the same in emacs - the session contains group of folders. Note that there is
It is
It has single
You can have multiple server connections for one session. You can have multiple server connections for single workspace folder. You can have multiple server connections for single file/buffer. You can have one server managing multiple workspace folders(multi-root),
They map to one server connection managing multiple folders.
Usually you have one multi-root connection managing all project of one type(e. g. JDTLS will manage all java projects). Server that does not support multi-root will run one per project(workspace folder).
Let say you have java projects A/B. Typically, when you open a file from one of them, both of them will be sent to the server(this is how multi-root works). If you use the snippet and you open a file from A then the server will be started in project A. When you open file from B we won't start new server but we will send |
Beta Was this translation helpful? Give feedback.
When I started working on
lsp-mode
it didn't have the notion of workspace folders and it didn't have multi-root support. Unfortunately, the project was using the termw…