|
@@ -38,63 +38,26 @@ elseif vim.fn.executable("gofmt") == 1 then
|
|
|
end
|
|
|
|
|
|
if vim.fn.executable("node_modules/.bin/tsc") == 1 then
|
|
|
-
|
|
|
- local ts_utils = require("nvim-lsp-ts-utils")
|
|
|
-
|
|
|
- nvim_lsp.tsserver.setup({
|
|
|
- init_options = ts_utils.init_options,
|
|
|
- flags = {
|
|
|
- debounce_text_changes = 150,
|
|
|
- },
|
|
|
- on_attach = function(client, bufnr)
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- client.resolved_capabilities.document_formatting = false
|
|
|
- client.resolved_capabilities.document_range_formatting = false
|
|
|
-
|
|
|
-
|
|
|
- ts_utils.setup({
|
|
|
- debug = false,
|
|
|
- disable_commands = false,
|
|
|
- enable_import_on_completion = true,
|
|
|
-
|
|
|
-
|
|
|
- import_all_timeout = 5000,
|
|
|
-
|
|
|
- import_all_priorities = {
|
|
|
- same_file = 1,
|
|
|
- local_files = 2,
|
|
|
- buffer_content = 3,
|
|
|
- buffers = 4,
|
|
|
- },
|
|
|
- import_all_scan_buffers = 100,
|
|
|
- import_all_select_source = false,
|
|
|
-
|
|
|
-
|
|
|
- filter_out_diagnostics_by_severity = {},
|
|
|
- filter_out_diagnostics_by_code = {},
|
|
|
-
|
|
|
-
|
|
|
- auto_inlay_hints = false,
|
|
|
- inlay_hints_highlight = "Comment",
|
|
|
-
|
|
|
-
|
|
|
- update_imports_on_move = false,
|
|
|
- require_confirmation_on_move = false,
|
|
|
- watch_dir = nil,
|
|
|
- })
|
|
|
-
|
|
|
-
|
|
|
- ts_utils.setup_client(client)
|
|
|
-
|
|
|
- on_attach(client, bufnr)
|
|
|
-
|
|
|
-
|
|
|
- local opts = { silent = true, buffer = bufnr }
|
|
|
-
|
|
|
- vim.keymap.set('n', 'gr', '<cmd>Telescope lsp_references default_text=!import\\ <CR>', opts)
|
|
|
- end,
|
|
|
+ require('typescript').setup({
|
|
|
+ server = {
|
|
|
+ flags = {
|
|
|
+ debounce_text_changes = 150,
|
|
|
+ },
|
|
|
+ on_attach = function(client, bufnr)
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ client.resolved_capabilities.document_formatting = false
|
|
|
+ client.resolved_capabilities.document_range_formatting = false
|
|
|
+
|
|
|
+ on_attach(client, bufnr)
|
|
|
+
|
|
|
+
|
|
|
+ local opts = { silent = true, buffer = bufnr }
|
|
|
+
|
|
|
+ vim.keymap.set('n', 'gr', '<cmd>Telescope lsp_references default_text=!import\\ <CR>', opts)
|
|
|
+ end
|
|
|
+ }
|
|
|
})
|
|
|
end
|
|
|
|