aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilliam Boman <william@redwill.se>2022-05-22 15:39:16 +0200
committerGitHub <noreply@github.com>2022-05-22 06:39:16 -0700
commit2972d9264b3de9dbd024f719e4746bb6bea36e30 (patch)
tree9256cf1da55ac0f9f852e6e3903ad0a32bd169d4
parentdocs: update server_configurations.md (diff)
downloadnvim-lspconfig-2972d9264b3de9dbd024f719e4746bb6bea36e30.tar
nvim-lspconfig-2972d9264b3de9dbd024f719e4746bb6bea36e30.tar.gz
nvim-lspconfig-2972d9264b3de9dbd024f719e4746bb6bea36e30.tar.bz2
nvim-lspconfig-2972d9264b3de9dbd024f719e4746bb6bea36e30.tar.lz
nvim-lspconfig-2972d9264b3de9dbd024f719e4746bb6bea36e30.tar.xz
nvim-lspconfig-2972d9264b3de9dbd024f719e4746bb6bea36e30.tar.zst
nvim-lspconfig-2972d9264b3de9dbd024f719e4746bb6bea36e30.zip
feat: add :LspLog command #1917
-rw-r--r--README.md2
-rw-r--r--doc/lspconfig.txt2
-rw-r--r--lua/lspconfig.lua7
3 files changed, 9 insertions, 2 deletions
diff --git a/README.md b/README.md
index d7a25bf4..a8537791 100644
--- a/README.md
+++ b/README.md
@@ -140,7 +140,7 @@ vim.lsp.set_log_level("debug")
Attempt to run the language server, and open the log with:
```
-:lua vim.cmd('e'..vim.lsp.get_log_path())
+:LspLog
```
Most of the time, the reason for failure is present in the logs.
diff --git a/doc/lspconfig.txt b/doc/lspconfig.txt
index d1d9103c..ffb738f4 100644
--- a/doc/lspconfig.txt
+++ b/doc/lspconfig.txt
@@ -608,7 +608,7 @@ the built-in client, specifically considering the RPC logs. Example:
Attempt to run the language server, and open the log with:
>
- :lua vim.cmd('e'..vim.lsp.get_log_path())
+ :LspLog
<
Note that `ERROR` messages containing `stderr` only indicate that the log was
sent to `stderr`. Many servers counter-intuitively send harmless messages
diff --git a/lua/lspconfig.lua b/lua/lspconfig.lua
index 8404632d..b99aa6ea 100644
--- a/lua/lspconfig.lua
+++ b/lua/lspconfig.lua
@@ -21,6 +21,13 @@ function M._root._setup()
'-nargs=0',
description = '`:LspInfo` Displays attached, active, and configured language servers',
},
+ LspLog = {
+ function()
+ vim.cmd(string.format('tabnew %s', vim.lsp.get_log_path()))
+ end,
+ '-nargs=0',
+ description = "`:LspLog` Opens the Nvim LSP client log.",
+ },
LspStart = {
function(server_name)
if server_name then