From b51f1ae28924a752258e7607fbc3210f9b18eaac Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Thu, 22 Jul 2021 00:08:36 +0200 Subject: Updates based on Chris's lunarvim --- .config/nvim/ftplugin/javascriptreact.lua | 41 +------------------------------ 1 file changed, 1 insertion(+), 40 deletions(-) (limited to '.config/nvim/ftplugin/javascriptreact.lua') diff --git a/.config/nvim/ftplugin/javascriptreact.lua b/.config/nvim/ftplugin/javascriptreact.lua index ff7cef2..fac6a20 100644 --- a/.config/nvim/ftplugin/javascriptreact.lua +++ b/.config/nvim/ftplugin/javascriptreact.lua @@ -1,41 +1,2 @@ -if not require("cfg.utils").check_lsp_client_active "tsserver" then - -- npm install -g typescript typescript-language-server - -- require'snippets'.use_suggested_mappings() - -- local capabilities = vim.lsp.protocol.make_client_capabilities() - -- capabilities.textDocument.completion.completionItem.snippetSupport = true; - -- local on_attach_common = function(client) - -- print("LSP Initialized") - -- require'completion'.on_attach(client) - -- require'illuminate'.on_attach(client) - -- end - require("lspconfig").tsserver.setup { - cmd = { - DATA_PATH .. "/lspinstall/typescript/node_modules/.bin/typescript-language-server", - "--stdio", - }, - filetypes = { - "javascript", - "javascriptreact", - "javascript.jsx", - "typescript", - "typescriptreact", - "typescript.tsx", - }, - on_attach = require("cfg.lsp").tsserver_on_attach, - -- This makes sure tsserver is not used for formatting (I prefer prettier) - -- on_attach = require'lsp'.common_on_attach, - root_dir = require("lspconfig/util").root_pattern("package.json", "tsconfig.json", "jsconfig.json", ".git"), - settings = { documentFormatting = false }, - handlers = { - ["textDocument/publishDiagnostics"] = vim.lsp.with(vim.lsp.diagnostic.on_publish_diagnostics, { - virtual_text = O.lang.tsserver.diagnostics.virtual_text, - signs = O.lang.tsserver.diagnostics.signs, - underline = O.lang.tsserver.diagnostics.underline, - update_in_insert = true, - }), - }, - } - require("lsp.ts-fmt-lint").setup() -end - +require "lsp.tsserver-ls" vim.cmd "setl ts=2 sw=2" -- cgit v1.2.3-70-g09d2