semanser
semanser

Reputation: 2348

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.

Upvotes: 4

Views: 3204

Answers (2)

Noel Evans
Noel Evans

Reputation: 8516

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.

Upvotes: 1

kLabz
kLabz

Reputation: 1847

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.

Upvotes: 1

Related Questions