4

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.

nponeccop
  • 13,527
  • 1
  • 44
  • 106
semanser
  • 2,310
  • 2
  • 15
  • 33
  • So far Neovim or Vim does a very good job for Typescript autocompletion but not for Javascript. I am waiting for someone to come up for a solution. The closest i got is by using LanguageClient-neovim together with javascript-typescript-server and it is super slow sometimes it doesn't even work. almost unusable. I don't know if i am using it wrong but it almost doesn't work. – Eskinder Nov 17 '18 at 21:10

2 Answers2

1

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.

kLabz
  • 1,837
  • 1
  • 14
  • 14
1

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.

Noel Evans
  • 8,113
  • 8
  • 48
  • 58