-
-
Notifications
You must be signed in to change notification settings - Fork 884
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
How to pass configuration data to language server? #167
Comments
See here, that is the way it is done for the rust language server. |
Could you give an example? What settings are you talking about? |
As far as I know this is a vscode accept a reference from language server like this https://github.com/palantir/python-language-server/blob/develop/vscode-client/package.json#L19 Without this feature I can not use this this plugin ( |
Yeah, as I have shown, you need to use
You will need to look into the linked package.json for all supported properties. Edit: |
@bkchr, thanks for help! |
I do not have a good experience with elisp ... @bkchr, can you help me with an example of how to set a value for a Interested property from package.json: "pyls.configurationSources": {
"type": "array",
"default": ["pycodestyle"],
"description": "List of configuration sources to use.",
"items": {
"type": "string",
"enum": ["pycodestyle", "pyflakes"]
} |
Sorry for the late answer. I'm also not the greatest elisp pro. You could try:
You need to call this function after the lsp-workspace was setup correctly, so I'm unsure if the |
Thanks for the help! It seems to me that such implementations at the level of a separate plugin are rather complicated. It would be cool to be able to describe the configuration yaml-file at the project level. |
Or maybe directly as json :D |
json is too hard for humans, but yaml is great =) In any case it seems to me more convenient than writing functions in each separate plugin |
How does vscode do it? If it's JSON or YAML, we can simply read that
instead.
…On 14-Nov-2017 6:45 PM, "CryptoManiac" ***@***.***> wrote:
json is too hard for humans, but yaml is great =)
In any case it seems to me more convenient than writing functions in each
separate plugin
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#167 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACCymJyjFYeL0PVWyInxdvW8Nn1c1lToks5s2ZJrgaJpZM4Qa2SI>
.
|
vscode store setting in {
"python.pythonPath": "/home/cryptomaniac/Devel/Envs/py3_backoffice/bin/python",
"python.envFile": "${workspaceRoot}/src/app/.env"
} Plugins provides allowed settings for vscode with files like this |
I like the general idea, but for example for the rust language server I use some options that are globally the same for all my projects. I would not want to create configurations per project. So, we should find a way on how we could integrate both. @cryptomaniac512 would you maybe want to create a pull request? Or do you think that your elisp knowledge is not sufficient? |
vscode allow to store settings globally as user. For example this is my vscode settings (I tried to use it) |
In reading the vscode settings it's the problem that they do not describe the configuration for the language server, but for the plug-in for the vscode that uses the language server |
I'll try to do this in the next couple of weeks. |
Any update on this? |
I'm currently doing it in my init.el like this:
|
Now dir locals could be used in combination of |
Greetings @yyoncho , some example to be able to replicate it? |
@arkhan - which language server do you want to use? |
@arkhan The rest of the settings(+ defaults) are here: https://raw.githubusercontent.com/palantir/python-language-server/develop/vscode-client/package.json Do you want to provide a PR adding the rest of the properties? ( I could finish the PR when I have more time) |
@yyoncho |
@arkhan |
@yyoncho It would be awesome to have |
@noctuid I do not use pyls, my guess is that the settings should be present in the set configuration request or it will default to nil/false. |
Is there an example of setting configuration when you run with only |
@axelson the best option is to extend the language server configuration that you want to use in lsp-clients.el to expose these options as a defcustom and then you could customize them in use-package. You may take a look at lsp-clients.el (go lang server in particular). You may register a function or the language server settings your language server using lsp-mode internal api but the approach with defcustoms is the recommended one.
|
@yyoncho okay, thanks. I'll give that a shot. |
With vscode, I can send the settings to the language server. for example, the path to the virtual environment or used linters for
pyls
. How to do it with this plugin?The text was updated successfully, but these errors were encountered: