refactor(nvim): move typescript-tools into lspconfig configuration
This commit is contained in:
parent
3036b24af6
commit
f410a1a34e
@ -4,6 +4,9 @@ local lspconfig = require("lspconfig")
|
||||
-- NOTE: Keep this near top
|
||||
mason_lspconfig.setup({
|
||||
automatic_installation = true,
|
||||
ensure_installed = {
|
||||
"tsserver",
|
||||
},
|
||||
})
|
||||
|
||||
local function on_attach(client, bufnr)
|
||||
@ -14,7 +17,7 @@ local function on_attach(client, bufnr)
|
||||
|
||||
-- Enable inlay hints if the language server provides them
|
||||
if client.server_capabilities.inlayHintProvider then
|
||||
vim.lsp.buf.inlay_hint(bufnr, true)
|
||||
vim.lsp.inlay_hint(bufnr, true)
|
||||
end
|
||||
end
|
||||
|
||||
@ -44,7 +47,7 @@ local rustopts = {
|
||||
inlay_hints = {
|
||||
-- automatically set inlay hints (type hints)
|
||||
-- default: true
|
||||
auto = false,
|
||||
auto = true,
|
||||
-- Only show inlay hints for the current line
|
||||
only_current_line = false,
|
||||
-- whether to show parameter hints with the inlay hints or not
|
||||
@ -287,25 +290,20 @@ lspconfig.texlab.setup({
|
||||
},
|
||||
})
|
||||
|
||||
local path = vim.fn.stdpath("config") .. "/spell/en.utf-8.add"
|
||||
local words = {}
|
||||
|
||||
for word in io.open(path, "r"):lines() do
|
||||
table.insert(words, word)
|
||||
end
|
||||
|
||||
-- lspconfig.ltex.setup({
|
||||
-- settings = {
|
||||
-- ltex = {
|
||||
-- dictionary = {
|
||||
-- ["en-US"] = words,
|
||||
-- },
|
||||
-- },
|
||||
-- },
|
||||
-- filetypes = { "bib", "markdown", "org", "plaintex", "rst", "rnoweb", "tex", "pandoc" },
|
||||
-- capabilities = lsp_capabilities,
|
||||
-- on_attach = on_attach,
|
||||
-- })
|
||||
-- Custom config from typescript tools
|
||||
require("typescript-tools").setup({
|
||||
on_attach = on_attach,
|
||||
settings = {
|
||||
tsserver_file_preferences = {
|
||||
includeInlayParameterNameHints = "all",
|
||||
includeInlayEnumMemberValueHints = true,
|
||||
includeInlayFunctionLikeReturnTypeHints = true,
|
||||
includeInlayFunctionParameterTypeHints = true,
|
||||
includeInlayPropertyDeclarationTypeHints = true,
|
||||
includeInlayVariableTypeHints = true,
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
-- NOTE: GENERIC LSP SERVERS
|
||||
for _, server in ipairs({
|
||||
|
@ -152,7 +152,6 @@ lazy.setup({
|
||||
-- Lspconfig
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
event = "VimEnter",
|
||||
dependencies = {
|
||||
"folke/neodev.nvim",
|
||||
"Decodetalkers/csharpls-extended-lsp.nvim",
|
||||
@ -161,6 +160,11 @@ lazy.setup({
|
||||
"simrat39/rust-tools.nvim",
|
||||
"Hoffs/omnisharp-extended-lsp.nvim",
|
||||
"b0o/schemastore.nvim",
|
||||
|
||||
{
|
||||
"pmizio/typescript-tools.nvim",
|
||||
dependencies = { "nvim-lua/plenary.nvim" },
|
||||
},
|
||||
},
|
||||
config = function()
|
||||
require("mason").setup({})
|
||||
@ -168,12 +172,6 @@ lazy.setup({
|
||||
end,
|
||||
},
|
||||
|
||||
{
|
||||
"pmizio/typescript-tools.nvim",
|
||||
dependencies = { "nvim-lua/plenary.nvim", "neovim/nvim-lspconfig" },
|
||||
opts = {},
|
||||
},
|
||||
|
||||
-- Show code actions
|
||||
{
|
||||
"kosayoda/nvim-lightbulb",
|
||||
@ -575,7 +573,7 @@ lazy.setup({
|
||||
"tex",
|
||||
"plaintex",
|
||||
},
|
||||
opts = {}
|
||||
opts = {},
|
||||
},
|
||||
|
||||
-- Tint inactive windows
|
||||
|
Loading…
x
Reference in New Issue
Block a user