ballerina-platform / lsp4intellij

This language client library provides language server protocol support for IntelliJ IDEA and other Jetbrains IDEs.
Apache License 2.0
428 stars 104 forks source link

Add IDE notifications for LSP progress update messages #348

Closed ThemiraChathumina closed 3 months ago

ThemiraChathumina commented 3 months ago

Purpose

Adds editor event log tab notifications for LSP messages that display progress update information. Display notifications for start and end of a work done progress. This also fixes the issue https://github.com/ballerina-platform/lsp4intellij/issues/347 that happens due to not supporting LSP progress indication messages.

Approach

createProgress(WorkDoneProgressCreateParams params): This method is triggered upon receiving a window/workDoneProgress/create request from the language server. It extracts the progress token from the request parameters, which can be either a String or a numeric value. This token uniquely identifies the progress report session. The method then initializes a progress notification item with a default title and an empty message, associating it with the token in a map for later reference. This setup prepares the IDE to handle upcoming progress notifications associated with this token.

notifyProgress(ProgressParams params): Activated by the $/progress notification from the language server, this method manages the display of progress notifications within the IDE. It first retrieves the progress token from the notification parameters, similar to createProgress. Using this token, it fetches the corresponding progress notification item from the map. The method then updates the title and message based on the type of progress notification received (e.g., WorkDoneProgressBegin, WorkDoneProgressEnd).

Notification will be associated with the extension name provided when initializing the language client.

Samples

image

image

CLAassistant commented 3 months ago

CLA assistant check
All committers have signed the CLA.