Use a separate config file to specify root (or other plugin options) #22
Replies: 3 comments
-
Yes, only one instance of a language server is started. The start of a server process triggers the initialization request. As long as this server is not restarted, no further initialization request is sent. As already mentioned, the client informs the server about the known root folders as part of the initialization request. Depending on what the server supports, this means that it either responds to a single root folder or to several workspace folders. If the server supports multiple workspace folders, each time a buffer is activated, the client checks to see if the current FAW root folders have changed and informs the server of the changes if they have. The client does NOT know how a server handles such information. Whether it treats the different root folders as different projects or as a single project depends on the server. As far as I know, there is currently no specification in the protocol that would allow a client and a server to define how to use such workspace folders. However, there is a request that is not yet supported by the client that allows the server to ask the client how a workspace is configured or needs to be set up, at least that is my understanding. From the perspective of NppLspClient, I would say that you can run different language servers in one session at the same time, but only have one project per server in mind. If you want to work on several projects per server in parallel, you should use different Npp instances. |
Beta Was this translation helpful? Give feedback.
-
This means that we have to check it individually in each server, which is a bit tedious. But LSP coverage in each server is at a different level, so it's less surprising. We just need to test a lot.
I eventually thought about that too, but I would rather avoid it. Fortunately, this LSP for JS works in such an interesting way that it treats such folders as different projects (I just have to use configuration files pointing to the files of a given project in each such folders). |
Beta Was this translation helpful? Give feedback.
-
But wouldn't that mean that you have to remember to maintain this file as well? Think about how you work on a project - how do you do it? Now suppose you were asked to review/fix a file of another project that uses the same server. However, this in turn means that workspace folders can no longer be determined. For example, if there is a file X that cannot be determined from the root directory of either project A or project B, which server should it be assigned to? I don't like the current situation 100% either, but I don't yet see how this could really be improved. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Mentions:
#15 (comment)
#15 (comment)
@Ekopalypse At first I have a few basic questions:
Let's say the file
fileA1.js
is active, we run server, and now we go tofileB1.js
. Initialization will occur 2x? Will it somehow remember the settings for both folders separately or will one overwrite the settings of the other?I'm testing it for JS and it looks like it's able to process configurations for each folder separately (when I go to different folders they respect their configuration file). The exception is when both folders use the same file (e.g. from outside), then when I'm in such a file the hints in it only work for one folder (the one that first processed
jsconfig.json
).Beta Was this translation helpful? Give feedback.
All reactions