Updated ts-tools to use node modules bin if there
Updated neovim project back to main repo
This commit is contained in:
@@ -6,12 +6,7 @@ return {
|
||||
"neovim/nvim-lspconfig",
|
||||
"hrsh7th/cmp-nvim-lsp",
|
||||
},
|
||||
ft = {
|
||||
"javascript",
|
||||
"javascriptreact",
|
||||
"typescript",
|
||||
"typescriptreact",
|
||||
},
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
config = function()
|
||||
local typescript_tools = require("typescript-tools")
|
||||
local cmp_nvim_lsp = require("cmp_nvim_lsp")
|
||||
@@ -20,6 +15,16 @@ return {
|
||||
local capabilities = cmp_nvim_lsp.default_capabilities()
|
||||
local augroup = vim.api.nvim_create_augroup("Typescript_tools", {})
|
||||
|
||||
local cwd = vim.fn.getcwd()
|
||||
local tsserver_path = cwd .. "/node_modules/.bin/tsserver"
|
||||
|
||||
local cmd = ""
|
||||
if vim.loop.fs_stat(tsserver_path) then
|
||||
cmd = tsserver_path
|
||||
else
|
||||
cmd = "typescript-language-server"
|
||||
end
|
||||
|
||||
typescript_tools.setup({
|
||||
capabilities = capabilities,
|
||||
on_attach = function(client, bufnr)
|
||||
@@ -32,8 +37,12 @@ return {
|
||||
vim.lsp.buf.format({ async = false })
|
||||
end,
|
||||
})
|
||||
if cmd == "typescript-language-server" then
|
||||
print("Using global tsserver")
|
||||
end
|
||||
end,
|
||||
settings = {
|
||||
cmd = { cmd, "--stdio" },
|
||||
tsserver_file_preferences = {
|
||||
includeCompletionsForModuleExports = true,
|
||||
quotePreference = "auto",
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
--- @type LazyPluginSpec
|
||||
return {
|
||||
-- "coffebar/neovim-project",
|
||||
"TakenMC/neovim-project",
|
||||
branch = "projetloadcommand",
|
||||
-- "neovim-project",
|
||||
-- dir = "~/git/neovim-project",
|
||||
"coffebar/neovim-project",
|
||||
priority = 100,
|
||||
dependencies = {
|
||||
{ "nvim-lua/plenary.nvim" },
|
||||
|
||||
Reference in New Issue
Block a user