ecosse3 / nvim

A non-minimal Neovim config built to work most efficiently with Frontend Development
GNU General Public License v3.0
1.22k stars 107 forks source link

No active LSP with not-included LSP servers #42

Closed techapostle closed 2 years ago

techapostle commented 2 years ago

Before the last 1 or 2 commits, I could edit c++, python, and java files with the LSP servers that I installed in addition to your included ones. I could do this without creating any additional config files of my own. Now though, I can't use clangd or pyright or any other LSP server that isn't included with your package. Any guidance on how I can enable/configure these LSP servers?

ecosse3 commented 2 years ago

Hi. Yes, that's right - now LSP servers installed via lsp-installer are not enabled automatically. That was a breaking change in nvim-lsp-installer announced here: https://github.com/williamboman/nvim-lsp-installer/discussions/636

Now, you always have to call setup function of specific lspconfig server in order to enable it. You don't need to install it by yourself because it will be installed automatically.

crakton commented 2 years ago

Hi. Yes, that's right - now LSP servers installed via lsp-installer are not enabled automatically. That was a breaking change in nvim-lsp-installer announced here: williamboman/nvim-lsp-installer#636

Now, you always have to call setup function of specific lspconfig server in order to enable it. You don't need to install it by yourself because it will be installed automatically.

HI. Based on @techapostle complaint. I don't understand your answer to it. I want to enable lsp server according to the README file but when I navigated to the 'lua/lsp/config.lua' I can not find any related line that concerns lsp-servers. I tried using :TSInstall maintained but here is the error am getting:


E5108: Error executing lua ...er/start/nvim-treesitter/lua/nvim-treesitter/install.lua:373: Parser not available for language maintained stack traceback:
[C]: in function 'get_parser_install_info' ...er/start/nvim-treesitter/lua/nvim-treesitter/install.lua:373: in function 'install_lang' ...er/start/nvim-treesitter/lua/nvim-treesitter/install.lua:419: in function 'run' [string ":lua"]:1: in main chunk


I really love the effort from this project but I do seems to get along with lua script since am a noob. What should I do to get the lsp server to work with my React projects?

techapostle commented 2 years ago

the TSInstall command is for TreeSitter which provides additional syntax highlighting for your code. It's not related to the installation of LSP servers. Running :checkhealth may give you more insight into the error.

techapostle commented 2 years ago

@ecosse3 Thank you for your reply. I looked over the link provided and it seems like I'm supposed to call that function inside your lsp/config.lua file. Is that correct?

ecosse3 commented 2 years ago

@techapostle I have changed it a bit with v1.6.0 release and updated README.

You can edit lua/lsp/setup.lua file now and just another lspconfig.<server>.setup {} function. LSP server will be installed automatically and enabled.

In case you don't want any merge conflicts with Ecovim in future, you can create your own lua file and call lspconfig setup functions there. Then just require it at the end of init.lua as you want.

You can check installed LSP servers by :LspInstallInfo.

Let me know if that works for you!

techapostle commented 2 years ago

@ecosse3 that works great. Thanks!