aboutsummaryrefslogtreecommitdiffstats
path: root/lua
diff options
context:
space:
mode:
authorMarek Vospel <73162071+marekvospel@users.noreply.github.com>2025-02-08 19:10:54 +0100
committerGitHub <noreply@github.com>2025-02-08 10:10:54 -0800
commitafd59cf6b5ff4e713c1d478ab8e8344aded1e314 (patch)
tree12d06b847914c361703836182d6cf2d0a5cb1872 /lua
parentdocs: update configs.md (diff)
downloadnvim-lspconfig-afd59cf6b5ff4e713c1d478ab8e8344aded1e314.tar
nvim-lspconfig-afd59cf6b5ff4e713c1d478ab8e8344aded1e314.tar.gz
nvim-lspconfig-afd59cf6b5ff4e713c1d478ab8e8344aded1e314.tar.bz2
nvim-lspconfig-afd59cf6b5ff4e713c1d478ab8e8344aded1e314.tar.lz
nvim-lspconfig-afd59cf6b5ff4e713c1d478ab8e8344aded1e314.tar.xz
nvim-lspconfig-afd59cf6b5ff4e713c1d478ab8e8344aded1e314.tar.zst
nvim-lspconfig-afd59cf6b5ff4e713c1d478ab8e8344aded1e314.zip
feat(oxc): OxcFixAll command #3604
Diffstat (limited to 'lua')
-rw-r--r--lua/lspconfig/configs/oxlint.lua21
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 = [[