update config
This commit is contained in:
+61
-25
@@ -1,41 +1,77 @@
|
||||
-- Mason setup
|
||||
require("mason").setup()
|
||||
require("mason-lspconfig").setup({
|
||||
ensure_installed = { "pyright", "html", "cssls", "quick_lint_js" }, -- Ensure pyright is installed
|
||||
ensure_installed = {
|
||||
"basedpyright",
|
||||
"html",
|
||||
"cssls",
|
||||
"quick_lint_js",
|
||||
"clangd",
|
||||
"ts_ls",
|
||||
"lua_ls",
|
||||
},
|
||||
})
|
||||
|
||||
-- Load lspconfig
|
||||
local lspconfig = require("lspconfig")
|
||||
local nvlsp = require "nvchad.configs.lspconfig"
|
||||
require("mason-tool-installer").setup({
|
||||
ensure_installed = {
|
||||
"black",
|
||||
"debugpy",
|
||||
"flake8",
|
||||
"isort",
|
||||
"mypy",
|
||||
"pylint",
|
||||
},
|
||||
})
|
||||
|
||||
-- Set up servers
|
||||
local servers = { "html", "cssls", "pyright", "quick_lint_js" }
|
||||
-- NvChad LSP defaults
|
||||
local nvlsp = require("nvchad.configs.lspconfig")
|
||||
|
||||
require("lspconfig").qmlls.setup {}
|
||||
-- Define servers
|
||||
local servers = { "html", "cssls", "basedpyright", "quick_lint_js", "qmlls" }
|
||||
vim.lsp.enable(servers)
|
||||
|
||||
for _, lsp in ipairs(servers) do
|
||||
lspconfig[lsp].setup({
|
||||
-- Use the new Neovim 0.11 LSP config API
|
||||
for _, server in ipairs(servers) do
|
||||
vim.lsp.config(server, {
|
||||
on_attach = nvlsp.on_attach,
|
||||
on_init = nvlsp.on_init,
|
||||
capabilities = nvlsp.capabilities,
|
||||
})
|
||||
end
|
||||
|
||||
lspconfig.pyright.setup({
|
||||
on_attach = function(client, bufnr)
|
||||
-- You can add custom on_attach behavior here, such as keymaps or other actions.
|
||||
end,
|
||||
capabilities = require('cmp_nvim_lsp').default_capabilities(), -- If you're using nvim-cmp
|
||||
})
|
||||
|
||||
-- Install necessary tools using mason-tool-installer
|
||||
require('mason-tool-installer').setup({
|
||||
ensure_installed = {
|
||||
'black',
|
||||
'debugpy',
|
||||
'flake8',
|
||||
'isort',
|
||||
'mypy',
|
||||
'pylint',
|
||||
vim.lsp.config("lua_ls", {
|
||||
settings = {
|
||||
Lua = {
|
||||
workspace = {
|
||||
library = {
|
||||
"/usr/share/hypr/stubs",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
vim.lsp.config("basedpyright", {
|
||||
settings = {
|
||||
pyright = {
|
||||
disableOrganizeImports = true
|
||||
},
|
||||
basedpyright = {
|
||||
analysis = {
|
||||
typeCheckingMode = "standard"
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
vim.lsp.config("pyright", {
|
||||
on_attach = function(client, bufnr)
|
||||
end,
|
||||
capabilities = require("cmp_nvim_lsp").default_capabilities(),
|
||||
},
|
||||
|
||||
vim.filetype.add({
|
||||
extension = {
|
||||
log = "log",
|
||||
},
|
||||
}))
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
local lspconfig = require('lspconfig')
|
||||
|
||||
-- Basic Pyright setup
|
||||
lspconfig.pyright.setup({
|
||||
on_attach = function(client, bufnr)
|
||||
-- Optional: Add keybindings or other configurations
|
||||
end,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user