Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reconsider usage of enviroment variables #72

Open
DoctorKrolic opened this issue Sep 16, 2023 · 1 comment
Open

Reconsider usage of enviroment variables #72

DoctorKrolic opened this issue Sep 16, 2023 · 1 comment
Labels

Comments

@DoctorKrolic
Copy link
Collaborator

The main idea of a language server protocol is to provide intellisense in as client-independent way as possible. In practice, however, language servers do often contain client-dependent elements. One of such cases is using enviroment variables. I'm not saying here, that we should get rid of them all together. Even official C# extension from MS uses enviroment variables for configuring some aspects of a language server. However, it's in our interest to maintain this LSP as client-independent as possible, so it can be used outside of our own VS Code extension (see #33). Thus, IMO, we should reconsider usage of enviroment variables and avoid them as much as possible. Ideally, enviroment variables should only be used to configure options, that must be present on server startup.

For instance, we use MSBUILD_PROJECT_TOOLS_DIR variable as a base path task cache storage. Why do we need it if we can just use relative path for that?

Another example is MSBUILD_PROJECT_TOOLS_VERBOSE_LOGGING. Do we really need to know this information on server startup or we can use standard configuration endpoint? I think the latter is sufficient for our needs.

In the end, we should question every variable we use with this model of thinking. Those variables, that can be avoided, should be deleted

@tintoy
Copy link
Owner

tintoy commented Sep 16, 2023

Yeah I agree, there has probably been a gradual accumulation of these, but the logging ones definitely do need to be there though; otherwise we cannot log anything until after the client has first connected and sent us the initial configuration (and that initial logging has proved to be essential on several occasions!). Anything that we don’t need to know until after the client first connects is fair game though.

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

No branches or pull requests

2 participants