-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Adding support for LSP window/showMessage method
#2652
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
doc/ale.txt
Outdated
|
|
||
| To configure the strings used on the `%severity%` field, see |g:ale_echo_msg_format|. | ||
|
|
||
| The echo message format can also be configured separately for each buffer, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This format is not actually configurable per buffer (I kept the text on purpose). Not sure if it even makes sense, this is not a channel for the server to flag anything specific regarding a file. I'd suggest having a dict to configure the format per server or file type but that looks like too much hassle for too little benefit really.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks pretty good. See my comments here.
Sorry for the delay.
autoload/ale/lsp/window.vim
Outdated
| \ 'error': s:LSP_MESSAGE_TYPE_ERROR, | ||
| \ 'warning': s:LSP_MESSAGE_TYPE_WARNING, | ||
| \ 'information': s:LSP_MESSAGE_TYPE_INFORMATION, | ||
| \ 'log': s:LSP_MESSAGE_TYPE_LOG |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add another severity level which disables the messages completely, in case people don't want to see them. The numeric value can be 0. I'm happy with the default being 'error'.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. Also made 'info' an alias for 'information' so the user can set either. (Can remove if sticking strictly to LSP naming is preferred)
autoload/ale/lsp/window.vim
Outdated
| " Discard log severity for now | ||
| if l:type is# s:LSP_MESSAGE_TYPE_LOG | ||
| return | ||
| endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because you have the setting for controlling the log level, you can show log level messages if the level is set that high, now that the default is to only show error messages.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, will also add a new config, g:ale_echo_msg_log_str, to configure the string
|
Done with the last comments; kept discussions open on items that need an OK. |
|
Cheers! 🍻 Sorry for the delay. I will eventually get to everything. I'll update the documentation too to mention the |
* master: (39 commits) Fix the test issues with html-beautify Add support for html-beautify (dense-analysis#2788) fixers/stylelint: enhance `stylelint` fixer (dense-analysis#2745) Fix dense-analysis#2835 - Bump up the sign group version check for NeoVim Mention the disabled option for message severity Adding support for LSP `window/showMessage` method (dense-analysis#2652) Fix tsserver not returning details for items with empty source Allow code actions to work on callback based sources Add support for nimlsp (dense-analysis#2815) Add definition of c/clangd's language as C (dense-analysis#2791) Bump the ALE version Fix TCP server config example. Suboptimal fix to prevent variables from leaking out of new clangd test Hopefully fixed issue with Windows paths Added tests for clangd compile commands dectection Updated ale_linters/c/clangd.vim to match ale_linters/cpp/clangd.vim Fix dense-analysis#2800 - Ignore completion user data which is not a dictionary Fix dense-analysis#2821 - Fix the debride linter after merging older code Add the possiblity to add extra psalm options fix tflint handler for 0.11+ (dense-analysis#2775) ...
* Added base handling for window/showMessage * Ignoring severity log * Code formatting * Added user configurable severity * Preferring ale#util#ShowMessage over echo'ing directly * Using format similar to ale_echo_msg_format for consistency * Updating docs * Added LSP log config string; improved tests * Use warning as fallback for incorrect user config
Text received via this methods is added to the message stream.
Implementation notes:
g:ale_lsp_show_message_formatto tweak the format; default is'%severity%:%linter%: %text%'(this value includes all options implemented)window/showMessagecan have severity "log", which seems the same aswindow/logMessage. Since I could not find a logging mechanism, I chose to ignore them. An alternative would be to log like Info, but that might lead to flooding the UIErrorMsgandWarningMsgrespectively, please advise if there's an ALE specific highlight group that's better suited