How does the plugin handle RPC requests for 'workspace/configuration' from Language Server Protocol (LSP)?

已回答

I have developed an LSP (Language Server Protocol) for a new language, and it runs well on VSCode. Now, I want to add support for this language in IntelliJ IDEA.

The language server sends 'workspace/configuration' requests to fetch user-specific settings. To support this request, I have added a SettingsComponent, SettingsState, and SettingsConfigurable to the plugin. The implementation is as follows


I would like the 'workspace/configuration' request to retrieve the content pointed to by the red arrow. How can I achieve this?

 

I tried to override the 'configuration' function in the Lsp4jClient, but it is marked as final, and I cannot override it. I also attempted to add multiple functions to handle the same request, but it still resulted in an error.

 

0
正式评论

Hi,

First of all, make sure you have the LSP API source code available in your IntelliJ Plugin project. See the red banner here for help: https://plugins.jetbrains.com/docs/intellij/language-server-protocol.html#plugin-configuration

Once you have the LSP API source code configured, you'll find the answer in the documentation for the LspServerDescriptor.getWorkspaceConfiguration() function.

请先登录再写评论。