Skip to content

Commit

Permalink
chore(lsp): adjust formatters and servers
Browse files Browse the repository at this point in the history
  • Loading branch information
cfcosta committed Sep 24, 2024
1 parent 8123749 commit 2ee274c
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 53 deletions.
15 changes: 15 additions & 0 deletions plugins/conform/default.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
inputs,
mkPlugin,
pkgs,
...
}:
let
Expand All @@ -14,5 +15,19 @@ mkPlugin {
"lspconfig"
];

inputs = with pkgs; [
beancount
cmake-format
gofumpt
jq
nixfmt-rfc-style
ruff
shellcheck
shfmt
stylua
taplo
yq
];

config = readFile ./configuration.lua;
}
52 changes: 8 additions & 44 deletions plugins/lspconfig/configuration.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
local lspconfig = require("lspconfig")
local util = require("lspconfig.util")

------------------------------------------------------------------
-- Diagnostic Symbols
Expand Down Expand Up @@ -50,54 +49,19 @@ vim.api.nvim_set_keymap("n", "<leader>cr", "<cmd>lua vim.lsp.buf.rename()<CR>",
------------------------------------------------------------------
lspconfig.aiken.setup({})
lspconfig.bashls.setup({})
lspconfig.beancount.setup({})
lspconfig.bufls.setup({})
lspconfig.clangd.setup({})
lspconfig.docker_compose_language_server.setup({})
lspconfig.dockerls.setup({})
lspconfig.gopls.setup({})
lspconfig.jq.setup({})
lspconfig.nixd.setup({})
lspconfig.postgres_lsp.setup({})
lspconfig.postgres_lsp.setup({})

------------------------------------------------------------------
-- Python
------------------------------------------------------------------
local root_files = {
"pyproject.toml",
"setup.py",
"setup.cfg",
"requirements.txt",
"Pipfile",
"pyrightconfig.json",
".git",
}

lspconfig.pyright.setup({
default_config = {
cmd = { "pyright-langserver", "--stdio" },
filetypes = { "python" },
root_dir = function(fname)
return util.root_pattern(unpack(root_files))(fname)
end,
single_file_support = true,
settings = {
pyright = {
disableOrganizeImports = true,
},
python = {
analysis = {
autoSearchPaths = true,
useLibraryCodeForTypes = true,
diagnosticMode = "workspace",
autoImportCompletions = true,
},
},
},
},
})

lspconfig.ruff_lsp.setup({
on_attach = function(client, _)
client.server_capabilities.hoverProvider = false
end,
})
lspconfig.ruff.setup({})
lspconfig.ruff_lsp.setup({})
lspconfig.taplo.setup({})

------------------------------------------------------------------
-- Lua
Expand Down
15 changes: 6 additions & 9 deletions plugins/lspconfig/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,20 @@ mkPlugin {
inputs = with pkgs; [
aiken
bash-language-server
beancount-language-server
buf-language-server
cairo-lang
clang-tools
cmake-format
docker-compose-language-service
dockerfile-language-server-nodejs
gopls
jq
jq-lsp
lua-language-server
luajitPackages.luacheck
nixd
nixfmt-rfc-style
nodePackages.dockerfile-language-server-nodejs
nodePackages.vscode-langservers-extracted
postgres-lsp
pyright
ruff
ruff-lsp
shellcheck
shfmt
taplo-lsp
];

config = readFile ./configuration.lua;
Expand Down

0 comments on commit 2ee274c

Please sign in to comment.