Skip to content

Commit

Permalink
feat: add LspLogClear command
Browse files Browse the repository at this point in the history
Adds command to clear the Nvim LSP log file.
  • Loading branch information
BrotifyPacha committed Sep 17, 2023
1 parent cc388d3 commit 6f8d1c3
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions plugin/lspconfig.lua
Original file line number Diff line number Diff line change
Expand Up @@ -155,3 +155,14 @@ api.nvim_create_user_command('LspLog', function()
end, {
desc = 'Opens the Nvim LSP client log.',
})

api.nvim_create_user_command('LspLogClear', function()
vim.ui.input({ prompt = 'Confirm clearing the Nvim LSP logs (y/n): ' }, function(input)
if string.lower(input) ~= 'y' then
return
end
io.open(vim.lsp.get_log_path(), 'w'):close()
end)
end, {
desc = 'Clears the Nvim LSP client logs',
})

0 comments on commit 6f8d1c3

Please sign in to comment.