From b63f23c0da57e68800e3babd9fe20f42b6bec4ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yann=20C=C3=A9bron?= Date: Mon, 4 Mar 2024 17:41:41 +0100 Subject: [PATCH] language_server_protocol.md: Status Bar Integration, code snippet --- .../custom_language_support/language_server_protocol.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/topics/reference_guide/custom_language_support/language_server_protocol.md b/topics/reference_guide/custom_language_support/language_server_protocol.md index 1c52eb81d..b27ca022b 100644 --- a/topics/reference_guide/custom_language_support/language_server_protocol.md +++ b/topics/reference_guide/custom_language_support/language_server_protocol.md @@ -119,6 +119,13 @@ private class FooLspServerDescriptor(project: Project) : ProjectWideLspServerDes Since 2024.1, a dedicated Language Services status bar widget is available to monitor the status of all LSP servers. Override `LspServerSupportProvider.createLspServerWidgetItem()` to provide a custom icon and link to [Settings](settings.md) page (if available). +```kotlin +override fun getLspServerWidgetItem(lspServer: LspServer, + currentFile: VirtualFile?) = + LspServerWidgetItem(lspServer, currentFile, + FooIcons.PluginIcon, FooConfigurable::class.java) +``` + If there are configuration problems preventing from starting an LSP server, the plugin can provide a widget item with an error and give the user a hint how to fix the problem.