Updated config
This commit is contained in:
@@ -13,9 +13,8 @@ return {
|
||||
config = function()
|
||||
require("lspconfig")
|
||||
local tserrortranslator = require("ts-error-translator")
|
||||
local util = require("lspconfig.util")
|
||||
local on_attach = require("taken.utils.on_attach")
|
||||
local path = util.path
|
||||
local get_python_path = require("taken.utils.lsp").get_python_path
|
||||
|
||||
-- local cmp_nvim_lsp = require("cmp_nvim_lsp")
|
||||
-- local capabilities = cmp_nvim_lsp.default_capabilities()
|
||||
@@ -23,11 +22,26 @@ return {
|
||||
local blink = require("blink.cmp")
|
||||
local capabilities = blink.get_lsp_capabilities()
|
||||
|
||||
local signs = { Error = " ", Warn = " ", Hint = "ﴞ ", Info = " " }
|
||||
for type, icon in pairs(signs) do
|
||||
local hl = "DiagnosticSign" .. type
|
||||
vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = "" })
|
||||
end
|
||||
vim.diagnostic.config({
|
||||
signs = {
|
||||
[vim.diagnostic.severity.ERROR] = " ",
|
||||
[vim.diagnostic.severity.WARN] = " ",
|
||||
[vim.diagnostic.severity.HINT] = "ﴞ ",
|
||||
[vim.diagnostic.severity.INFO] = " ",
|
||||
},
|
||||
-- linehl = {
|
||||
-- [vim.diagnostic.severity.ERROR] = "DiagnosticSignError",
|
||||
-- [vim.diagnostic.severity.WARN] = "DiagnosticSignWarn",
|
||||
-- [vim.diagnostic.severity.HINT] = "DiagnosticSignHint",
|
||||
-- [vim.diagnostic.severity.INFO] = "DiagnosticSignInfo",
|
||||
-- },
|
||||
-- numhl = {
|
||||
-- [vim.diagnostic.severity.ERROR] = "DiagnosticSignError",
|
||||
-- [vim.diagnostic.severity.WARN] = "DiagnosticSignWarn",
|
||||
-- [vim.diagnostic.severity.HINT] = "DiagnosticSignHint",
|
||||
-- [vim.diagnostic.severity.INFO] = "DiagnosticSignInfo",
|
||||
-- },
|
||||
})
|
||||
|
||||
local defaultLsps = {
|
||||
"html",
|
||||
@@ -45,6 +59,11 @@ return {
|
||||
on_attach = on_attach,
|
||||
})
|
||||
|
||||
-- vim.lsp.config("emmylua_ls", {
|
||||
-- capabilities = capabilities,
|
||||
-- on_attach = on_attach,
|
||||
-- })
|
||||
|
||||
-- lua
|
||||
vim.lsp.config("lua_ls", {
|
||||
capabilities = capabilities,
|
||||
@@ -70,23 +89,6 @@ return {
|
||||
},
|
||||
})
|
||||
|
||||
local function get_python_path(workspace)
|
||||
-- Use activated virtualenv.
|
||||
if vim.env.VIRTUAL_ENV then
|
||||
return path.join(vim.env.VIRTUAL_ENV, "bin", "python")
|
||||
end
|
||||
|
||||
-- Find and use virtualenv in workspace directory.
|
||||
for _, pattern in ipairs({ "*", ".*" }) do
|
||||
local match = vim.fn.glob(path.join(workspace, pattern, "pyvenv.cfg"))
|
||||
if match ~= "" then
|
||||
return path.join(path.dirname(match), "bin", "python")
|
||||
end
|
||||
end
|
||||
|
||||
return nil
|
||||
end
|
||||
|
||||
-- python
|
||||
vim.lsp.config("pyright", {
|
||||
capabilities = capabilities,
|
||||
@@ -140,10 +142,13 @@ return {
|
||||
})
|
||||
|
||||
vim.lsp.enable(defaultLsps)
|
||||
vim.lsp.enable("lua_ls")
|
||||
vim.lsp.enable("pyright")
|
||||
vim.lsp.enable("ts_ls")
|
||||
vim.lsp.enable("powershell_es")
|
||||
vim.lsp.enable({
|
||||
"lua_ls",
|
||||
-- "emmylua_ls",
|
||||
"pyright",
|
||||
"ts_ls",
|
||||
"powershell_es",
|
||||
})
|
||||
|
||||
tserrortranslator.setup()
|
||||
end,
|
||||
|
||||
@@ -39,6 +39,7 @@ return {
|
||||
"tailwindcss",
|
||||
"marksman",
|
||||
"eslint",
|
||||
"emmylua_ls",
|
||||
},
|
||||
automatic_installation = true,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user