summaryrefslogtreecommitdiff
path: root/plugin/lsp.lua
diff options
context:
space:
mode:
authorseth <[email protected]>2024-10-29 22:37:49 -0400
committerGitHub <[email protected]>2024-10-30 02:37:49 +0000
commit310fdf8de53d98ddd3a56936c131186e25814f0f (patch)
treef4265ab11de2262bacb2498cdc4661420a2df278 /plugin/lsp.lua
parent7ed0a2b87684eb32009944bd9eb8d7eaa9af0462 (diff)
use lz.n (#69)
* remove bufferline & some cmp sources * factor things out of after/ folder This is bad practice or something * make sure ftdetect plugins aren't loaded multiple times * use lz.n * mini.pairs -> mini.surround * flake: cleanup checks * ftplugin: enforce spaces in nix files
Diffstat (limited to 'plugin/lsp.lua')
-rw-r--r--plugin/lsp.lua137
1 files changed, 0 insertions, 137 deletions
diff --git a/plugin/lsp.lua b/plugin/lsp.lua
deleted file mode 100644
index 5815574..0000000
--- a/plugin/lsp.lua
+++ /dev/null
@@ -1,137 +0,0 @@
-if vim.g.did_load_lsp_plugin then
- return
-end
-vim.g.did_load_lsp_plugin = true
-
-local lsp_servers = {
- astro = {
- binary = "astro-ls",
- },
-
- bashls = {
- binary = "bash-language-server",
- },
-
- cssls = {
- binary = "vscode-css-language-server",
- },
-
- clangd = {},
-
- denols = {
- binary = "deno",
- },
-
- dprint = {},
-
- eslint = {
- binary = "vscode-eslint-language-server",
- },
-
- html = {
- binary = "vscode-html-language-server",
- },
-
- jsonls = {
- binary = "vscode-json-language-server"
- },
-
- -- TODO: I WANT STYLUA BACK!!
- lua_ls = {
- binary = "lua-language-server",
- extraOptions = {
- settings = {
- Lua = {
- runtime = { version = "LuaJIT" },
- diagnostics = { globals = "vim" },
- workspace = { checkThirdPaty = false, library = { vim.env.VIMRUNTIME } },
- },
- },
- },
- },
-
- nil_ls = {
- binary = "nil",
- extraOptions = {
- settings = {
- ["nil"] = {
- formatting = { command = { "nixfmt" } },
- },
- },
- },
- },
-
- nim_langserver = {
- binary = "nimlangserver",
- },
-
- pyright = {
- extraOptions = {
- settings = {
- -- ruff is used instead
- pyright = { disableOrganizeImports = true },
- python = { ignore = { "*" } },
- },
- },
- },
-
- ruff_lsp = {
- binary = "ruff-lsp",
- extraOptions = {
- on_attach = function(client, _)
- require("lsp-format").on_attach(client)
- -- pyright should handle this
- client.server_capabilities.hoverProvider = false
- end,
- },
- },
-
- rust_analyzer = {
- binary = "rust-analyzer",
- extraOptions = {
- settings = {
- ["rust-analyzer"] = {
- check = { command = "clippy" },
- },
- },
- },
- },
-
- ts_ls = {
- binary = "typescript-language-server",
- },
-
- typos_lsp = {
- binary = "typos-lsp",
- },
-
- typst_lsp = {
- binary = "typst-lsp",
- },
-}
-
-local caps = vim.tbl_deep_extend(
- "force",
- vim.lsp.protocol.make_client_capabilities(),
- require("cmp_nvim_lsp").default_capabilities(),
- -- for nil_ls
- { workspace = { didChangeWatchedFiles = { dynamicRegistration = true } } }
-)
-
-local setup = {
- on_attach = function(client, _)
- require("lsp-format").on_attach(client)
- end,
-
- capabilities = caps,
-}
-
-for server, config in pairs(lsp_servers) do
- local binary = config.binary or server
-
- local options = (config.extraOptions == nil) and setup or vim.tbl_extend("keep", config.extraOptions, setup)
-
- if vim.fn.executable(binary) == 1 then
- require("lspconfig")[server].setup(options)
- end
-end