more none-ls cleanup and adding LSPs :D

This commit is contained in:
Noah Håkansson 2024-02-24 19:58:28 +01:00
parent d56f84739b
commit 6d751b38f1
2 changed files with 20 additions and 4 deletions

View File

@ -544,7 +544,7 @@ end, 0)
-- [[ Configure LSP ]] -- [[ Configure LSP ]]
-- This function gets run when an LSP connects to a particular buffer. -- This function gets run when an LSP connects to a particular buffer.
local on_attach = function(_, bufnr) local on_attach = function(client, bufnr)
-- NOTE: Remember that lua is a real programming language, and as such it is possible -- NOTE: Remember that lua is a real programming language, and as such it is possible
-- to define small helper and utility functions so you don't have to repeat yourself -- to define small helper and utility functions so you don't have to repeat yourself
-- many times. -- many times.
@ -592,6 +592,12 @@ local on_attach = function(_, bufnr)
command = 'EslintFixAll', command = 'EslintFixAll',
}) })
end end
-- When using pyright and ruff_lsp, disable hover in favor of Pyright
if client.name == 'ruff_lsp' then
-- Disable hover in favor of Pyright
client.server_capabilities.hoverProvider = false
end
end end
-- document existing key chains -- document existing key chains
@ -660,8 +666,19 @@ local servers = {
}, },
}, },
bashls = {}, bashls = {},
ruff_ls = {}, ruff_lsp = {},
pyright = {}, pyright = {
pyright = {
-- Using Ruff's import organizer
disableOrganizeImports = true,
},
python = {
analysis = {
-- Ignore all files for analysis to exclusively use Ruff for linting
ignore = { '*' },
},
},
},
rust_analyzer = {}, rust_analyzer = {},
-- tsserver = {}, -- tsserver = {},
html = { filetypes = { 'html', 'twig', 'hbs' } }, html = { filetypes = { 'html', 'twig', 'hbs' } },

View File

@ -18,7 +18,6 @@ function M.config()
sources = { sources = {
-- Formatters -- Formatters
formatting.stylua, formatting.stylua,
formatting.black,
formatting.prettier.with({ formatting.prettier.with({
filetypes = { filetypes = {
'css', 'css',