diff options
| author | Michael Lingelbach <m.j.lbach@gmail.com> | 2021-03-19 22:17:39 -0700 |
|---|---|---|
| committer | Michael Lingelbach <m.j.lbach@gmail.com> | 2021-03-19 22:17:39 -0700 |
| commit | 7e492867a05b9d421c2abbe1b037300cb44b73bf (patch) | |
| tree | 0e3f40f220fdbc07c4480c7837a41a7cf19a210b /README.md | |
| parent | [docgen] Update CONFIG.md (diff) | |
| download | nvim-lspconfig-7e492867a05b9d421c2abbe1b037300cb44b73bf.tar nvim-lspconfig-7e492867a05b9d421c2abbe1b037300cb44b73bf.tar.gz nvim-lspconfig-7e492867a05b9d421c2abbe1b037300cb44b73bf.tar.bz2 nvim-lspconfig-7e492867a05b9d421c2abbe1b037300cb44b73bf.tar.lz nvim-lspconfig-7e492867a05b9d421c2abbe1b037300cb44b73bf.tar.xz nvim-lspconfig-7e492867a05b9d421c2abbe1b037300cb44b73bf.tar.zst nvim-lspconfig-7e492867a05b9d421c2abbe1b037300cb44b73bf.zip | |
Update Readme
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 30 |
1 files changed, 16 insertions, 14 deletions
@@ -79,8 +79,6 @@ the `name`, `log_level`, `message_level`, and `settings` of texlab: local lspconfig = require'lspconfig' lspconfig.texlab.setup{ name = 'texlab_fancy'; - log_level = vim.lsp.protocol.MessageType.Log; - message_level = vim.lsp.protocol.MessageType.Log; settings = { latex = { build = { @@ -120,14 +118,28 @@ lspconfig.foo_lsp.setup{} ### Example: override default config for all servers -If you want to change default configs for all servers, you can override default_config like this. +If you want to change default configs for all servers, you can override default_config like this. In this example, we additionally add a check for log_level and message_level which can be passed to the server to control the verbosity of "window/logMessage". ```lua local lspconfig = require'lspconfig' lspconfig.util.default_config = vim.tbl_extend( "force", lspconfig.util.default_config, - { log_level = lsp.protocol.MessageType.Warning.Error } + { + autostart = false, + handlers = { + ["window/logMessage"] = function(err, method, params, client_id) + if params and params.type <= vim.lsp.protocol.MessageType.Log then + vim.lsp.handlers["window/logMessage"](err, method, params, client_id) + end + end; + ["window/showMessage"] = function(err, method, params, client_id) + if params and params.type <= vim.lsp.protocol.MessageType.Warning.Error then + vim.lsp.handlers["window/showMessage"](err, method, params, client_id) + end + end; + } + } ) ``` @@ -267,16 +279,6 @@ lspconfig.SERVER.setup{config} Whether to automatically start a language server when a matching filetype is detected. Defaults to true. - {log_level} - controls the level of logs to show from window/logMessage notifications. Defaults to - vim.lsp.protocol.MessageType.Warning instead of - vim.lsp.protocol.MessageType.Log. - - {message_level} - controls the level of messages to show from window/showMessage notifications. Defaults to - vim.lsp.protocol.MessageType.Warning instead of - vim.lsp.protocol.MessageType.Log. - {settings} Map with case-sensitive keys corresponding to `workspace/configuration` event responses. |
