mirror of
https://github.com/dense-analysis/ale.git
synced 2026-01-18 09:05:14 +08:00
Adding support for LSP window/showMessage method (#2652)
* 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
This commit is contained in:
49
doc/ale.txt
49
doc/ale.txt
@@ -801,6 +801,15 @@ g:ale_echo_msg_info_str *g:ale_echo_msg_info_str*
|
||||
The string used for `%severity%` for info. See |g:ale_echo_msg_format|
|
||||
|
||||
|
||||
g:ale_echo_msg_log_str *g:ale_echo_msg_log_str*
|
||||
|
||||
Type: |String|
|
||||
Default: `'Log'`
|
||||
|
||||
The string used for `%severity%` for log, used only for handling LSP show
|
||||
message requests. See |g:ale_lsp_show_message_format|
|
||||
|
||||
|
||||
g:ale_echo_msg_warning_str *g:ale_echo_msg_warning_str*
|
||||
|
||||
Type: |String|
|
||||
@@ -1251,6 +1260,46 @@ b:ale_loclist_msg_format *b:ale_loclist_msg_format*
|
||||
|
||||
The strings for configuring `%severity%` are also used for this option.
|
||||
|
||||
|
||||
g:ale_lsp_show_message_format *g:ale_lsp_show_message_format*
|
||||
|
||||
Type: |String|
|
||||
Default: `'%severity%:%linter%: %s'`
|
||||
|
||||
This variable defines the format that messages received from an LSP will
|
||||
have when echoed. The following sequences of characters will be replaced.
|
||||
|
||||
`%s` - replaced with the message text
|
||||
`%linter%` - replaced with the name of the linter
|
||||
`%severity%` - replaced with the severity of the message
|
||||
|
||||
The strings for `%severity%` levels "error", "info" and "warning" are shared
|
||||
with |g:ale_echo_msg_format|. Severity "log" is unique to
|
||||
|g:ale_lsp_show_message_format| and it can be configured via
|
||||
|
||||
|g:ale_echo_msg_log_str| - Defaults to `'Log'`
|
||||
|
||||
Please note that |g:ale_lsp_show_message_format| *can not* be configured
|
||||
separately for each buffer like |g:ale_echo_msg_format| can.
|
||||
|
||||
|
||||
g:ale_lsp_show_message_severity *g:ale_lsp_show_message_severity*
|
||||
|
||||
Type: |String|
|
||||
Default: `'error'`
|
||||
|
||||
This variable defines the minimum severity level an LSP message needs to be
|
||||
displayed. Messages below this level are discarded; please note that
|
||||
messages with `Log` severity level are always discarded.
|
||||
|
||||
Possible values follow the LSP spec `MessageType` definition:
|
||||
|
||||
`'error'` - Displays only errors.
|
||||
`'warning'` - Displays errors and warnings.
|
||||
`'information'` - Displays errors, warnings and infos
|
||||
`'log'` - Same as `'information'`
|
||||
|
||||
|
||||
g:ale_lsp_root *g:ale_lsp_root*
|
||||
b:ale_lsp_root *b:ale_lsp_root*
|
||||
|
||||
|
||||
Reference in New Issue
Block a user