diff options
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/lspconfig/configs/oxlint.lua | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/lua/lspconfig/configs/oxlint.lua b/lua/lspconfig/configs/oxlint.lua index 4bfbd9fd..c82985f6 100644 --- a/lua/lspconfig/configs/oxlint.lua +++ b/lua/lspconfig/configs/oxlint.lua @@ -15,6 +15,27 @@ return { }, root_dir = util.root_pattern('.oxlintrc.json'), single_file_support = false, + + commands = { + OxcFixAll = { + function() + local client = vim.lsp.get_clients({ bufnr = 0, name = 'oxlint' })[1] + if client == nil then + return + end + + client.request('workspace/executeCommand', { + command = 'oxc.fixAll', + arguments = { + { + uri = vim.uri_from_bufnr(0), + }, + }, + }, nil, 0) + end, + description = 'Apply fixes to current buffer using oxlint (--fix)', + }, + }, }, docs = { description = [[ |
