-
-
Notifications
You must be signed in to change notification settings - Fork 33
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
Is there any rationale preventing from implementing an editor-agnostic config file feature? #133
Comments
Did you read the docs of LTEX CLI, in particular the option |
I didn't catch this one, but you have to explicitly interact with the language server to enable this behavior. Is there any way to use a
|
Ah, I see. No, there is no such way. The reason is that the Language Server Protocol (LSP) puts the responsibility for the configuration to the language client. Servers should request and fetch the config from the client via In addition, it would be even more confusing that it already is to find out where a particular setting comes from, considering that editor settings, magic comments, Babel commands, external setting files, etc. all can influence the settings as well. Regarding point 1: The LSP is already editor-agnostic with its Regarding point 2: If the structure of the configuration storage of your editor does not fit your needs (e.g., because VS Code does not support |
Thank you for laying out those explanations! I will just add a few comments, with my limited understanding of the problem space:
That's a fair point. It can be mitigated though by ignoring the editor settings when a config file is detected. A config file would imply this specific set of options is required for this workspace to maximize the chances of a reproducible execution of the program. Optionally, and to help end-users, the extension could report warnings when both editor and standalone configurations exists, and suggests deleting editor configuration entries.
With this proposal, the client (the extension) could choose to read a standalone config file, that would not break the LSP spec as far as I understand it.
That holds true when the definition of "client" is restricted to the editor which has its own configuration scheme, and not the extension. Many VSCode extensions use standalone configuration files precisely because it has to be committed to an SCM, and because it cannot be editor-dependent. To sum things up, I think there are two ways of considering the issue:
While writing my thoughts and doing some research, I realize that there is no consensus regarding committing In the end, I still think standalone configuration has merits for editor-independent online collaboration, but at the same time I do understand that you have to make design choices to limit complexity and stand by some philosophical guidelines to preserve consistency and quality in the long run. In any case, thank you for this amazing tool! |
Sorry, I didn't read your previous comment properly. You want the client to read configuration files and pass them on to the server. Yeah, that would be LSP-compliant. I guess I was confused because you opened this issue in the repo of ltex-ls, which is the server part and which doesn't know anything about editor extensions. vscode-ltex already does this for some settings (dictionaries, hidden false positives, etc.) with the external setting files feature. The reason for that is that the values of these settings can become quite large, which would make the I think the request to be able to read in settings from external files other than IMO, this is really something that should be implemented/supported by VS Code itself. Not sure if there's already an issue about this over at microsoft/vscode. |
That is, the possibility to configure LTEX with a simple JSON or YML file.
Could be implemented with the help of https://github.com/davidtheclark/cosmiconfig
Would be very convenient for open source projects :-)
The text was updated successfully, but these errors were encountered: