Updated config for 0.11
This commit is contained in:
@@ -11,7 +11,7 @@ return {
|
|||||||
},
|
},
|
||||||
event = { "BufReadPre", "BufNewFile" },
|
event = { "BufReadPre", "BufNewFile" },
|
||||||
config = function()
|
config = function()
|
||||||
local lspconfig = require("lspconfig")
|
require("lspconfig")
|
||||||
local tserrortranslator = require("ts-error-translator")
|
local tserrortranslator = require("ts-error-translator")
|
||||||
local util = require("lspconfig.util")
|
local util = require("lspconfig.util")
|
||||||
local on_attach = require("taken.utils.on_attach")
|
local on_attach = require("taken.utils.on_attach")
|
||||||
@@ -37,20 +37,16 @@ return {
|
|||||||
"yamlls",
|
"yamlls",
|
||||||
"bashls",
|
"bashls",
|
||||||
"marksman",
|
"marksman",
|
||||||
"eslint",
|
-- "eslint",
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, lsp in ipairs(defaultLsps) do
|
vim.lsp.config("*", {
|
||||||
lspconfig[lsp].setup({
|
|
||||||
capabilities = capabilities,
|
|
||||||
on_attach = on_attach,
|
|
||||||
})
|
|
||||||
end
|
|
||||||
|
|
||||||
-- lua
|
|
||||||
lspconfig["lua_ls"].setup({
|
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
|
})
|
||||||
|
|
||||||
|
-- lua
|
||||||
|
vim.lsp.config("lua_ls", {
|
||||||
settings = {
|
settings = {
|
||||||
Lua = {
|
Lua = {
|
||||||
hint = {
|
hint = {
|
||||||
@@ -90,9 +86,7 @@ return {
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- python
|
-- python
|
||||||
lspconfig["pyright"].setup({
|
vim.lsp.config("pyright", {
|
||||||
capabilities = capabilities,
|
|
||||||
on_attach = on_attach,
|
|
||||||
before_init = function(_, config)
|
before_init = function(_, config)
|
||||||
local python_path = get_python_path(config.root_dir)
|
local python_path = get_python_path(config.root_dir)
|
||||||
if python_path == nil then
|
if python_path == nil then
|
||||||
@@ -103,9 +97,7 @@ return {
|
|||||||
})
|
})
|
||||||
|
|
||||||
-- typescript
|
-- typescript
|
||||||
lspconfig["ts_ls"].setup({
|
vim.lsp.config("ts_ls", {
|
||||||
capabilities = capabilities,
|
|
||||||
on_attach = on_attach,
|
|
||||||
settings = {
|
settings = {
|
||||||
typescript = {
|
typescript = {
|
||||||
inlayHints = {
|
inlayHints = {
|
||||||
@@ -135,12 +127,16 @@ return {
|
|||||||
})
|
})
|
||||||
|
|
||||||
-- powershell
|
-- powershell
|
||||||
lspconfig["powershell_es"].setup({
|
vim.lsp.config("powershell_es", {
|
||||||
capabilities = capabilities,
|
|
||||||
on_attach = on_attach,
|
|
||||||
bundle_path = vim.fn.stdpath("data") .. "/mason/packages/powershell-editor-services",
|
bundle_path = vim.fn.stdpath("data") .. "/mason/packages/powershell-editor-services",
|
||||||
})
|
})
|
||||||
|
|
||||||
|
vim.lsp.enable(defaultLsps)
|
||||||
|
vim.lsp.enable("lua_ls")
|
||||||
|
vim.lsp.enable("pyright")
|
||||||
|
vim.lsp.enable("ts_ls")
|
||||||
|
vim.lsp.enable("powershell_es")
|
||||||
|
|
||||||
tserrortranslator.setup()
|
tserrortranslator.setup()
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user