Skip to content

fix: Show progress messages in detail - #647

Merged
angelozerr merged 1 commit into
redhat-developer:mainfrom
seachicken:progress-detail
Dec 4, 2024
Merged

angelozerr merged 1 commit into
redhat-developer:mainfrom
seachicken:progress-detail

Conversation

@seachicken

Copy link
Copy Markdown
Contributor

Hello. When I use $/progress, the detailed message is displayed on the front.
スクリーンショット 2024-12-01 9 23 13

The detailed message is displayed as text2 in the IntelliJ ProgressIndicator API.
The LSP title and message seem to correspond to the following:

LSP IntelliJ API
title ProgressIndicator.text()
message ProgressIndicator.text2()

https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#workDoneProgress

@angelozerr

Copy link
Copy Markdown
Contributor

I have never understood the difference betweeb setText and setText2.

@SCWells72 what do you think about this change?

@SCWells72

Copy link
Copy Markdown
Contributor

@angelozerr, the behavior differs based on whether the progress indicator is displayed in the status bar (as in the attached screenshot) or in a modal dialog. When displayed in a modal dialog, setText() is for the text displayed above the progress bar, and setText2() is for the text displayed below the progress bar. When displayed in the status bar, my experience has generally been that setText2() doesn't really do much, so I've always used setText() for progress displayed that way.

Typically I would think that title would be what you set as the progress indicator title when the process is started, and message would correspond to setText(), but I can imagine there might be a bit of a catch-22 here with needing to start the progress indicator before calling the language server, so I think mapping title to setText() and message to setText2() seems reasonable.

@angelozerr

Copy link
Copy Markdown
Contributor

Thanks @SCWells72 for your feedback.

Most of code that I have seen in IJ community github uses setText.

I think LSP4IJ should continue to use setText

@seachicken if you need really this call of setText2 we could provide an LSP Api?

@seachicken

Copy link
Copy Markdown
Contributor Author

IntelliJ's "Scanning files to index" also seems to display detailed information in text2, and looking at the SDK documentation, it seems like an appropriate solution.

image

https://plugins.jetbrains.com/docs/intellij/progress-bar.html#process-details

However, I will close the PR if many LSP users expect text. Thanks.

@angelozerr

Copy link
Copy Markdown
Contributor

@seachicken I have not strong opinion about that. If you think it is better I can merge it.

@seachicken

Copy link
Copy Markdown
Contributor Author

@angelozerr In my opinion, the index target file name being visible to IDE users seems noisy and inconsistent with the standard indicators.
Customizing the LSP API is also a bit difficult, so changing it to text2 is not a bad idea.

@angelozerr
angelozerr merged commit 3311b09 into redhat-developer:main Dec 4, 2024
@angelozerr

Copy link
Copy Markdown
Contributor

Thanks @seachicken !

@seachicken
seachicken deleted the progress-detail branch December 4, 2024 04:42
@angelozerr angelozerr added enhancement New feature or request $/progress https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#progress labels Dec 4, 2024
@angelozerr angelozerr added this to the 0.9.0 milestone Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request $/progress https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#progress

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants