summaryrefslogtreecommitdiff
path: root/plugin
diff options
context:
space:
mode:
Diffstat (limited to 'plugin')
-rw-r--r--plugin/lint.lua15
-rw-r--r--plugin/lsp.lua12
2 files changed, 20 insertions, 7 deletions
diff --git a/plugin/lint.lua b/plugin/lint.lua
new file mode 100644
index 0000000..2a7f3a9
--- /dev/null
+++ b/plugin/lint.lua
@@ -0,0 +1,15 @@
+require("lint").linters_by_ft = {
+ githubaction = { "actionlint" },
+ lua = { "selene" },
+ nix = { "statix" },
+}
+
+vim.api.nvim_create_autocmd({ "BufWritePost" }, {
+ callback = function()
+ -- Run linters declared in linters_by_ft
+ require("lint").try_lint()
+
+ -- Run these linters regardless of filetype
+ require("lint").try_lint("alex")
+ end,
+})
diff --git a/plugin/lsp.lua b/plugin/lsp.lua
index b652f71..ef1a90b 100644
--- a/plugin/lsp.lua
+++ b/plugin/lsp.lua
@@ -26,11 +26,7 @@ local lsp_servers = {
binary = "vscode-eslint-language-server",
},
- efm = {
- binary = "efm-langserver",
- extraOptions = require("getchoo.plugins.efmls"),
- },
-
+ -- TODO: I WANT STYLUA BACK!!
lua_ls = {
binary = "lua-language-server",
extraOptions = {
@@ -38,7 +34,7 @@ local lsp_servers = {
Lua = {
runtime = { version = "LuaJIT" },
diagnostics = { globals = "vim" },
- workspace = { library = vim.api.nvim_get_runtime_file("", true) },
+ workspace = { checkThirdPaty = false, library = { vim.env.VIMRUNTIME } },
},
},
},
@@ -84,7 +80,9 @@ local lsp_servers = {
binary = "rust-analyzer",
extraOptions = {
settings = {
- checkOnSave = { command = "clippy" },
+ ["rust-analyzer"] = {
+ check = { command = "clippy" },
+ },
},
},
},