You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there a way to send client config settings to a language client, e.g pyls?
I read the example from #32, where a simple example was provided. However the vscode api changed, in fact the provided example does not work.
I tried to adapt the example to the changed api, but my config is not send to pyls.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
@TypeFox Any update here? There is no documentation provided on how to do this, and without such documentation it is impossible to use this project with Python language servers among others.
Oh thank god I finally figured it out (by spending some hours inspecting the innards of vscode-languageserver-node). You have to add a middleware, like this:
(I won't guarantee the other stuff in that code will work for you, I had to hack a bunch of other things as well. But the middleware key should be correct. Of course you must adjust the actual content of the LSP configuration to taste.)
For anyone wondering how to actually use this project, you can refer to a complete working example integrating with backend language servers for Python, Ruby, Bash, Go, Rust, and 19 other languages.
In Riju, I see that you are using Microsoft's python language server. Is the binary available somewhere? Also, what steps did you take to configure it. It would be helpful for my use case to use a standalone server written in a single language rather than a patchwork of different libraries and extensions.
I am running Microsoft's python language server on a separate machine and want to connect with the monaco editor. And as per language server documentation I need to pass "python.linting.enabled": true config setting to the language server for enabling linting support.
I am using below config for creating MonacoLanguageClient instance.
new MonacoLanguageClient({
name: 'Simple Client',
clientOptions: {
// use a language id as a document selector
documentSelector: ['python'],
initializationOptions: {
interpreter: {
properties: {
UseDefaultDatabase: true,
Version: '2.7',
InterpreterPath: '/usr/bin/python',
LibraryPath: '/usr/lib/python2.7'
}
},
asyncStartup: true,
},
middleware: {
workspace: {
configuration: (params, token, configuration) => {
return[{python: { linting: {enabled: true}}}];
},
}
},
synchronize: {
configurationSection: ''
},
// disable the default error handler
errorHandler: {
error: () => ErrorAction.Continue,
closed: () => CloseAction.DoNotRestart
}
},
// create a language client connection from the JSON RPC connection on demand
connectionProvider: {
get: (errorHandler, closeHandler) => {
return Promise.resolve(createConnection( connection as any, errorHandler, closeHandler));
}
}
});
Its always sending blank setting to language server. {"jsonrpc":"2.0","method":"workspace/didChangeConfiguration","params":{"settings":{}}}
Is there anyway to send custom setting to language server?
I can't speak for the didChangeConfiguration message, Riju (linked above) has support for setting the initializationOptions in the initialize method (key init in Riju language configuration) as well as sending configuration in response to the workspace/configuration message (key config in Riju language configuration, currently unused but I just tested that it does work).
Activity
stale commentedon Apr 23, 2020
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
raxod502 commentedon Jun 23, 2020
@TypeFox Any update here? There is no documentation provided on how to do this, and without such documentation it is impossible to use this project with Python language servers among others.
raxod502 commentedon Jun 23, 2020
Oh thank god I finally figured it out (by spending some hours inspecting the innards of
vscode-languageserver-node). You have to add a middleware, like this:(I won't guarantee the other stuff in that code will work for you, I had to hack a bunch of other things as well. But the middleware key should be correct. Of course you must adjust the actual content of the LSP configuration to taste.)
The relevant part of
vscode-languageserver-nodeis where the middleware is pulled out and turned into config.raxod502 commentedon Aug 22, 2020
For anyone wondering how to actually use this project, you can refer to a complete working example integrating with backend language servers for Python, Ruby, Bash, Go, Rust, and 19 other languages.
umesh-timalsina commentedon Sep 22, 2020
Hello @raxod502. What is the middleware key are you referring to? Is it the name of the language server? Or is it something else?
raxod502 commentedon Sep 22, 2020
By "middleware key" I simply meant the data that appears immediately after
middleware:in the sample code.umesh-timalsina commentedon Sep 23, 2020
In Riju, I see that you are using Microsoft's python language server. Is the binary available somewhere? Also, what steps did you take to configure it. It would be helpful for my use case to use a standalone server written in a single language rather than a patchwork of different libraries and extensions.
raxod502 commentedon Sep 24, 2020
I suggest referring to the code.
itthought commentedon Oct 11, 2020
I am running Microsoft's python language server on a separate machine and want to connect with the monaco editor. And as per language server documentation I need to pass
"python.linting.enabled": trueconfig setting to the language server for enabling linting support.I am using below config for creating MonacoLanguageClient instance.
Its always sending blank setting to language server.
{"jsonrpc":"2.0","method":"workspace/didChangeConfiguration","params":{"settings":{}}}Is there anyway to send custom setting to language server?
raxod502 commentedon Oct 17, 2020
I can't speak for the didChangeConfiguration message, Riju (linked above) has support for setting the initializationOptions in the initialize method (key
initin Riju language configuration) as well as sending configuration in response to the workspace/configuration message (keyconfigin Riju language configuration, currently unused but I just tested that it does work).dkattan commentedon Jun 6, 2021
@itthought did you ever have any success populating the settings payload?
@raxod502 it looks like Riju was taken down, did you perhaps rename it?
raxod502 commentedon Jun 7, 2021
Unfortunately, that's not what happened. Please see https://intuitiveexplanations.com/tech/replit/ for the details.