-
Notifications
You must be signed in to change notification settings - Fork 63
Expand file tree
/
Copy pathtyptools.lua
More file actions
48 lines (45 loc) · 1.57 KB
/
typtools.lua
File metadata and controls
48 lines (45 loc) · 1.57 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
local M = {}
M.config = function()
local status_ok, tools = pcall(require, "typescript-tools")
if not status_ok then
return
end
local ok, lvim_lsp = pcall(require, "lvim.lsp")
if not ok then
return
end
local opts = {
capabilities = lvim_lsp.common_capabilities(),
on_attach = function(client, bufnr)
client.server_capabilities.documentFormattingProvider = false
client.server_capabilities.documentRangeFormattingProvider = false
lvim_lsp.common_on_attach(client, bufnr)
end,
settings = {
separate_diagnostic_server = true,
composite_mode = "separate_diagnostic",
publish_diagnostic_on = "insert_leave",
-- tsserver_logs = "verbose",
tsserver_file_preferences = {
importModuleSpecifierPreference = "non-relative",
},
tsserver_locale = "en",
-- mirror of VSCode's `typescript.suggest.completeFunctionCalls`
complete_function_calls = false,
include_completions_with_insert_text = true,
-- WARNING: Experimental feature also in VSCode, because it might hit performance of server.
-- possible values: ("off"|"all"|"implementations_only"|"references_only")
code_lens = "off",
disable_member_code_lens = true,
-- JSXCloseTag
-- WARNING: it is disabled by default (maybe you configuration or distro already uses nvim-ts-autotag,
-- that maybe have a conflict if enable this feature. )
jsx_close_tag = {
enable = false,
filetypes = { "javascriptreact", "typescriptreact" },
},
},
}
tools.setup(opts)
end
return M