-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypescript.lua
More file actions
93 lines (89 loc) · 2.39 KB
/
typescript.lua
File metadata and controls
93 lines (89 loc) · 2.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
--[[
TypeScript/JavaScript Plugin Configuration
-----------------------------------------
All TS/JS LSP, DAP, and related plugin setups.
Add or modify TypeScript/JavaScript plugins here.
]]
return {
-- TypeScript/JavaScript development
{
"pmizio/typescript-tools.nvim",
dependencies = { "nvim-lua/plenary.nvim", "neovim/nvim-lspconfig" },
opts = {
settings = {
separate_diagnostic_server = true,
publish_diagnostic_on = "insert_leave",
expose_as_code_action = {},
tsserver_path = nil,
tsserver_plugins = {},
tsserver_max_memory = "auto",
tsserver_format_options = {},
tsserver_file_preferences = {
includeInlayParameterNameHints = "all",
includeInlayParameterNameHintsWhenArgumentMatchesName = false,
includeInlayFunctionParameterTypeHints = true,
includeInlayVariableTypeHints = true,
includeInlayPropertyDeclarationTypeHints = true,
includeInlayFunctionLikeReturnTypeHints = true,
includeInlayEnumMemberValueHints = true,
},
tsserver_locale = "en",
complete_function_calls = false,
include_completions_with_insert_text = true,
code_lens = "off",
disable_member_code_lens = true,
},
},
},
-- LSP configuration
{
"neovim/nvim-lspconfig",
opts = {
servers = {
tsserver = {
enabled = false,
},
eslint = {
settings = {
workingDirectories = { mode = "auto" },
},
},
},
},
},
-- Treesitter for TS/JS
{
"nvim-treesitter/nvim-treesitter",
opts = function(_, opts)
vim.list_extend(opts.ensure_installed, {
"typescript",
"tsx",
"javascript",
"jsdoc",
})
-- Enable treesitter-based indentation
opts.indent = opts.indent or {}
opts.indent.enable = true
end,
},
-- Mason tools
{
"mason-org/mason.nvim",
opts = function(_, opts)
opts.ensure_installed = opts.ensure_installed or {}
vim.list_extend(opts.ensure_installed, {
"typescript-language-server",
"eslint-lsp",
"prettierd",
"eslint_d",
})
end,
},
-- Package.json management
{
"vuki656/package-info.nvim",
dependencies = { "MunifTanjim/nui.nvim" },
opts = {},
event = { "BufRead package.json" },
},
}