-
-
Notifications
You must be signed in to change notification settings - Fork 199
Sending configuration options #32
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
Comments
@jtokoph The monaco-languageclient is abstracted away from VS code via services, e.g. By the default, the subset of the services is implemented to support the standalone editor. You have to subclass monaco-languageclient/src/workspace.ts Line 11 in b901301
|
We could also pass an instance of |
PRs are welcomed. @jtokoph feel free to look into it |
#31 is done now |
@jtokoph Is there a workaround for now? Also struggling with the python language server. |
I managed to get this working by implementing my own configuration class. class WorkspaceConfiguration {
constructor(
config: any
) {
for (const key of Object.keys(config || {})) {
this[key] = config[key];
}
}
get<T>(section: string, defaultValue?: T) {
console.log(this);
return this[section] || defaultValue;
}
}
class Configuration {
private onConfigChanged: Function = () => {};
getConfiguration(section?: string) {
return new WorkspaceConfiguration(this[section]);
}
update(section: string, value: any, configurationTarget?: any) {
this[section] = value;
this.onConfigChanged();
}
onDidChangeConfiguration(cb: Function) {
this.onConfigChanged = cb;
}
} After that, you can set the const config = new Configuration();
// create and start the language client
const languageClient = createLanguageClient(connection);
(languageClient.workspace as any).configurations = config;
config.update('pyls', {
plugins: {
pydocstyle: {
enabled: false
}
}
}); If I find some time, and you are interested, I can do a PR. |
@SamVerschueren feel free to open the PR |
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. |
Is there an example of sending configuration options to the language server? For example, I'd like to be able to send a list of plugin options to the python language server. In vscode, it uses the synchronize option to send vscode config values. How would I go about manually sending config values from the monaco-language client?
These are the options I want to be able to send: https://github.com/palantir/python-language-server/blob/develop/vscode-client/package.json#L19
The text was updated successfully, but these errors were encountered: