Despite the docs stating that the LanguageClient
API supports workspace/didChangeConfiguration
that doesn’t seem to be the case, although maybe I’m just using the API wrong?
I’m working on the Intelephense language server extension and trying to add an option that will allow people to modify which stubs are available to the language server. That has to be done through the workspace/configuration
language server API.
This is what I’m trying right now, without success:
client.start();
// Send notification 2 seconds after server starts before sending
// new configuration to make sure server is running.
setTimeout(() => {
client.sendNotification(
'workspace/didChangeConfiguration',
{
settings: {
intelephense: {
stubs: [...stubsDefault, 'wordpress'],
},
'intelephense.stubs': [
...stubsDefault,
'wordpress',
],
},
intelephense: {
stubs: [...stubsDefault, 'wordpress'],
},
'intelephense.stubs': [
...stubsDefault,
'wordpress',
],
'settings.intelephense.stubs': [
...stubsDefault,
'wordpress',
],
}
);
}, 2000);
I’ve also tried wrapping the object parameter in an array ([ { intelephense: { stubs: [ /* ... */ ] } } ]
), and that doesn’t work either.
None of the ways I’ve tried here successfully update the stubs used by Intelephense; it still can’t find any information about WordPress functions.
Am I not using the API correctly? Is this an issue in Nova? Or do I need to implement support for workspace/configuration
manually?
I’m really not sure how to proceed here, and would love to get some input on what the intended use of the API is.