Skip to content

Commit

Permalink
fix(lsp): fix lsp installer loading issues
Browse files Browse the repository at this point in the history
Fixes #47
  • Loading branch information
ecosse3 committed May 14, 2022
1 parent f44f51d commit d84b928
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions lua/lsp/setup.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
-- Setup installer & lsp configs
local typescript_ok, typescript = pcall(require, 'typescript')
local lsp_installer_ok, lsp_installer = pcall(require, 'nvim-lsp-installer')

require("nvim-lsp-installer").setup {
if not lsp_installer_ok then
return
end

lsp_installer.setup {
-- A list of servers to automatically install if they're not already installed
ensure_installed = { "bashls", "cssls", "eslint", "graphql", "html", "jsonls", "sumneko_lua", "tailwindcss", "tsserver", "vetur", "vuels" },
-- Whether servers that are set up (via lspconfig) should be automatically installed if they're not already installed
Expand All @@ -26,7 +31,6 @@ end

-- Order matters


-- It enables tsserver automatically so no need to call lspconfig.tsserver.setup
if typescript_ok then
typescript.setup({
Expand Down
2 changes: 1 addition & 1 deletion lua/plugins.lua
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ return require('packer').startup({
use { 'cljoly/telescope-repo.nvim' }

-- LSP Base
use { 'williamboman/nvim-lsp-installer' }
use { 'neovim/nvim-lspconfig' }

-- LSP Cmp
Expand All @@ -57,7 +58,6 @@ return require('packer').startup({
use { 'saadparwaiz1/cmp_luasnip', after = 'cmp-npm' }

-- LSP Addons
use { 'williamboman/nvim-lsp-installer', event = 'BufEnter', after = 'cmp-nvim-lsp' }
use { 'stevearc/dressing.nvim', requires = 'MunifTanjim/nui.nvim', config = "require('plugins.dressing')" }
use { 'onsails/lspkind-nvim' }
use { 'folke/lsp-trouble.nvim', config = "require('plugins.trouble')" }
Expand Down

0 comments on commit d84b928

Please sign in to comment.