Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to use VSCode language-server-protocol engine along with the Vim or NeoVim?

I have tried different code-analysis engines and tools (like tern_for_vim) for Vim, but they do not provide such a great autocompletion, goto and rename functionality as in VSCode. As I know VSCode uses language-server-protocol technology to provide IDE functionality. So here is my question:

Is it possible to use VSCode language-server-protocol engine inside the Vim or NeoVim? In other words, it is possible to provide the same good quality of IDE-like functionality as VSCode do?

I have tried javascript-typescript-langserver with deoplete.vim, but the quality of autocompletion and goto-declaration was bad.

like image 391
semanser Avatar asked Sep 13 '25 08:09

semanser


2 Answers

Yes, you can use it via coc.nvim installing which is a fork of VSCode. You then apply one of its packages for a specific language eg coc-python.

This is the installation guide for coc.nvim. You then need to install the language package with this command in (Neo)Vim:

:CocInstall coc-python

You can then use the default VS Code completion engine immediately (jedi) or upgrade to what will become its successor, MSPLS:

For MSPLS run the command :CocConfig and enter this in to the file which is opened:

{
    "python.jediEnabled": false
}

Then run :CocRestart

There are other other engines like coc.nvim such as YouCompleteMe. They all have small variations / tailoring for specific languages.

like image 108
Noel Evans Avatar answered Sep 16 '25 06:09

Noel Evans


In theory, yes. http://langserver.org/ provides a list of editor plugins and language server implementations.

With packages like https://github.com/autozimu/LanguageClient-neovim (which is for neovim, there are others for both vim and neovim) you can use language servers in neovim.

However, some implementations are tied to the way it works within vscode (like haxe lsp), so it may be a little hard to get it working. Javascript should be better integrated, but I didn't try it myself.

like image 35
kLabz Avatar answered Sep 16 '25 06:09

kLabz