Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@suoto
Copy link
Contributor

@suoto suoto commented Jul 20, 2019

Text received via this methods is added to the message stream.

Implementation notes:

  • Use variable g:ale_lsp_show_message_format to tweak the format; default is '%severity%:%linter%: %text%' (this value includes all options implemented)
  • window/showMessage can have severity "log", which seems the same as window/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 UI
  • I've hard coded the highlights for error and warning severities to ErrorMsg and WarningMsg respectively, please advise if there's an ALE specific highlight group that's better suited

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,
Copy link
Contributor Author

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.

Copy link
Member

@w0rp w0rp left a 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.

\ 'error': s:LSP_MESSAGE_TYPE_ERROR,
\ 'warning': s:LSP_MESSAGE_TYPE_WARNING,
\ 'information': s:LSP_MESSAGE_TYPE_INFORMATION,
\ 'log': s:LSP_MESSAGE_TYPE_LOG
Copy link
Member

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'.

Copy link
Contributor Author

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)

" Discard log severity for now
if l:type is# s:LSP_MESSAGE_TYPE_LOG
return
endif
Copy link
Member

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.

Copy link
Contributor Author

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

@suoto
Copy link
Contributor Author

suoto commented Sep 30, 2019

Done with the last comments; kept discussions open on items that need an OK.

@w0rp w0rp merged commit 5e69aaf into dense-analysis:master Oct 18, 2019
@w0rp
Copy link
Member

w0rp commented Oct 18, 2019

Cheers! 🍻

Sorry for the delay. I will eventually get to everything. I'll update the documentation too to mention the 'disabled' option.

AntoineGagne added a commit to AntoineGagne/ale that referenced this pull request Oct 31, 2019
* 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)
  ...
timlag1305 pushed a commit to timlag1305/ale that referenced this pull request Nov 5, 2019
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants