Repository navigation
feat: show window/showMessage[Request] in a panel - #3053
Conversation
Messages from servers are now collected in a new "LSP Messages" output panel instead of being shown in the status bar (window/showMessage) or in a popup in the active view (window/showMessageRequest). Requests render their actions as buttons below the message and stay pending until an action is chosen or the request is dismissed, so they can no longer be dismissed accidentally. Pending requests are marked as expired when the server exits. The new "show_messages_panel_level" setting controls for which message levels the panel opens automatically. Requests always open the panel. Fixes #3014 Assisted-By: Claude Code:claude-opus-5-5
β Deploy Preview for sublime-lsp ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
| // Messages that servers want to show to the user (`window/showMessage`) are collected in | ||
| // the "LSP Messages" panel. Open that panel automatically when a message with a level equal | ||
| // to or less than the following is received: | ||
| // none: 0 (never open the panel automatically) | ||
| // error: 1 | ||
| // warning: 2 | ||
| // info: 3 | ||
| // log: 4 | ||
| // debug: 5 | ||
| // Messages that don't open the panel are additionally shown in the status bar. | ||
| // Requests that need a response from the user (`window/showMessageRequest`) always open the panel. | ||
| "show_messages_panel_level": 3, |
There was a problem hiding this comment.
Note that many servers seem to trigger window/showMessage. For example pyright does:
19:57:50 LSP-basedpyright ERROR
venv .venv subdirectory not found in venv path /usr/local/workspace/sublime-packages/LSP-aurelia.
so it probably would get too annoying to have this enabled by default.
There was a problem hiding this comment.
Well, that specific error is kinda fair because that package specifies:
[tool.basedpyright]
venvPath = "."
venv = ".venv"but the venv isn't created.
I guess people should test this and see if it's too trigger happy.
There was a problem hiding this comment.
I think default should be 0 because the status bar message is also the current behavior for non-request messages.
There was a problem hiding this comment.
Sure but there are many issues with the existing solution like no line breaks support and impossible to not miss, so this could be considered as an improvement.
Having feature enabled by default exposes it to the people who otherwise would not even notice that it exists. And then they still have an option of disabling it.
There was a problem hiding this comment.
I agree that 3 is too high. Error messages are usually important though. Maybe set to 1 so it only pops up for error messages?
There was a problem hiding this comment.
Do you know any servers that trigger info messages? I would like to see what the experience is then. But I can imagine that it could get annoying.
There was a problem hiding this comment.
Yes, basedpyright does at startup. See: #3053 (comment)
There was a problem hiding this comment.
Is value 1 OK or do you both still prefer to set it to disabled by default?
I guess in this case I'm leaning towards making user notice it and potentially disable if it gets annoying rather than missing the feature completely since I think the status approach is not really a good one.
There was a problem hiding this comment.
And I still kinda think that 3 would be better than 1 since this is about window/showMessage and not window/logMessage. The server really wants to communicate something to the user in that case.
| // Messages that servers want to show to the user (`window/showMessage`) are collected in | ||
| // the "LSP Messages" panel. Open that panel automatically when a message with a level equal | ||
| // to or less than the following is received: | ||
| // none: 0 (never open the panel automatically) | ||
| // error: 1 | ||
| // warning: 2 | ||
| // info: 3 | ||
| // log: 4 | ||
| // debug: 5 | ||
| // Messages that don't open the panel are additionally shown in the status bar. | ||
| // Requests that need a response from the user (`window/showMessageRequest`) always open the panel. | ||
| "show_messages_panel_level": 3, |
There was a problem hiding this comment.
I think default should be 0 because the status bar message is also the current behavior for non-request messages.
window/showMessage[Request] in a panel
| return "\n".join(lines) | ||
|
|
||
| def render_buttons(self) -> str: | ||
| buttons = [(str(idx), action['title'], idx == 0) for idx, action in enumerate(self.actions)] |
There was a problem hiding this comment.
I was thinking about this a bit. I think I introduced the primary class for the button in the rename panel because in that case it's used for the hardcoded "Apply" button.
But I'm not sure if it makes sense here to highlight the first button (with primary class), because there isn't any definition for that or any predefined ordering for the actions given in the LSP specs. So maybe it's wrong to just take the first button as "primary" (which I would interpret as something like the "preferred" or "confirm" option), and instead it would be better to use false for all available actions?
Like here it's kind of weird that the first button has a special color, when all 3 available actions are kind of independent without any prefernce for the item to select (this is a message request after running a unit test):
And it might even be slightly misleading that people might think it would highlight a focused button for keyboard input (Enter or arrow keys), which is not the case.
There was a problem hiding this comment.
At the same time I've made the dismiss button less prominent since it's the one that LSP adds itself
The LSP specification doesn't define a preferred action for window/showMessageRequest, so highlighting the first one as primary suggested a recommendation (or keyboard focus) that doesn't exist. All server actions now share the same style, and the Dismiss button added by LSP uses a new, less prominent secondary style. Assisted-By: Claude Code:claude-opus-5-5
rwols
left a comment
There was a problem hiding this comment.
I'd change the default for window/logMessage to 1 or 0, but other than that LGTM.
|
I thought LSP-basedpyright prints a lot of window/logMessage at startup, and it does: but I don't see these appear in the new "Messages" panel... Now I'm a bit confused. I thought |
I guess we should. It was mentioned many times in various places but perhaps nobody got around to creating an issue for it. |
Right... then... I think the default can actually stay at |
|
I'm okay to go with |
That will never happen :) |

Fixes #3014
window/showMessagenotifications andwindow/showMessageRequestrequests are now shown in a new "LSP Messages" output panel instead of the status bar and a popup in the active view.window/showMessageRequestactions are rendered as buttons below the message, plus a "Dismiss" button that responds withnull. The request stays pending until a button is clicked, so hiding the panel no longer dismisses it accidentally. Once answered, the buttons are replaced by a line with the outcome.show_messages_panel_levelsetting (default3, info) controls whichwindow/showMessagelevels open the panel automatically. Messages below that level are still added to the panel and also shown in the status bar like before. Requests always open the panel.LSP: Toggle Messages Panelcommand (Command Palette and main menu) and a context menu in the panel with Clear, Copy and Select All.Screenshots
A request with actions, waiting for a response:
After clicking "Create tsconfig.json":
Assisted-By: Claude Code:claude-opus-5-5
π€ Generated with Claude Code