ide features for Typescrript and JavaScript

This commit is contained in:
2026-03-27 09:46:41 +01:00
parent 38ad61c7d1
commit da04ee3883
4 changed files with 79 additions and 4 deletions
+33 -1
View File
@@ -14,6 +14,7 @@ return {
require("mason-lspconfig").setup({
ensure_installed = {
"pyright", -- Python
"tsserver", -- TypeScript/JavaScript
"jsonls", -- JSON
"yamlls", -- YAML
"html", -- HTML
@@ -41,7 +42,7 @@ return {
},
})
-- Other languages
-- Python
vim.lsp.config("pyright", {
settings = {
python = {
@@ -52,6 +53,36 @@ return {
},
},
})
-- Type- and JavaScript
vim.lsp.config("tsserver", {
settings = {
typescript = {
inlayHints = {
includeInlayParameterNameHints = "all",
includeInlayParameterNameHintsWhenArgumentMatchesName = false,
includeInlayFunctionParameterTypeHints = true,
includeInlayVariableTypeHints = true,
includeInlayPropertyDeclarationTypeHints = true,
includeInlayFunctionLikeReturnTypeHints = true,
includeInlayEnumMemberValueHints = true,
},
},
javascript = {
inlayHints = {
includeInlayParameterNameHints = "all",
includeInlayParameterNameHintsWhenArgumentMatchesName = false,
includeInlayFunctionParameterTypeHints = true,
includeInlayVariableTypeHints = true,
includeInlayPropertyDeclarationTypeHints = true,
includeInlayFunctionLikeReturnTypeHints = true,
includeInlayEnumMemberValueHints = true,
},
},
},
})
-- Other languages
vim.lsp.config("jsonls", {})
vim.lsp.config("yamlls", {})
vim.lsp.config("html", {})
@@ -61,6 +92,7 @@ return {
-- Enable servers
vim.lsp.enable("lua_ls")
vim.lsp.enable("pyright")
vim.lsp.enable("tsserver")
vim.lsp.enable("jsonls")
vim.lsp.enable("yamlls")
vim.lsp.enable("html")