vscode-neovim: MainController: Neovim exited with code: 0
When launching VSCode I get the following error messages:
2021-03-03T15:59:55.165Z MainController: Neovim exited with code: 0
and
2021-03-03T15:59:55.160Z MainController: Neovim was disconnected
This is my settings.json:
{
"workbench.colorTheme": "Gruvbox Material Dark",
"editor.fontFamily": "'Hack'",
"vscode-neovim.neovimExecutablePaths.linux": "/snap/bin/nvim",
"vscode-neovim.neovimInitVimPaths.linux": "/home/noah/.config/nvim/test.vim",
"vscode-neovim.highlightGroups.highlights": {
"Directory": "vim",
"IncSearch": {
"backgroundColor": "theme.editor.findMatchBackground",
"borderColor": "theme.editor.findMatchBorder"
},
"Search": {
"backgroundColor": "theme.editor.findMatchHighlightBackground",
"borderColor": "theme.editor.findMatchHighlightBorder"
},
"Visual": {
"backgroundColor": "theme.editor.selectionBackground"
},
"Conceal": "vim",
"Substitute": "vim"
},
}
~/.config/nvim/test.vim is a empty file, but I also tried it with my existing init.vim. Running which nvim
in the terminal outputs /snap/bin/nvim
.
Here’s the output of :checkhealth inside nvim with nvim -u test.vim:
health#nvim#check
========================================================================
## Configuration
- OK: no issues found
## Performance
- OK: Build type: RelWithDebInfo
## Remote Plugins
- OK: Up to date
## terminal
- INFO: key_backspace (kbs) terminfo entry: key_backspace=\177
- INFO: key_dc (kdch1) terminfo entry: key_dc=\E[3~
- INFO: $COLORTERM='truecolor'
health#provider#check
========================================================================
## Clipboard (optional)
- OK: Clipboard tool found: xclip
## Python 2 provider (optional)
- WARNING: No Python executable found that can `import neovim`. Using the first available executable for diagnostics.
- ERROR: Python provider error:
- ADVICE:
- provider/pythonx: Could not load Python 2:
/usr/bin/python2 does not have the "neovim" module. :help |provider-python|
/usr/bin/python2.7 does not have the "neovim" module. :help |provider-python|
python2.6 not found in search path or not executable.
/usr/bin/python is Python 3.8 and cannot provide Python 2.
- INFO: Executable: Not found
## Python 3 provider (optional)
- INFO: `g:python3_host_prog` is not set. Searching for python3 in the environment.
- INFO: Multiple python3 executables found. Set `g:python3_host_prog` to avoid surprises.
- INFO: Executable: /usr/bin/python3
- INFO: Other python executable: /bin/python3
- INFO: Python version: 3.8.6
- INFO: pynvim version: 0.4.3
- OK: Latest pynvim is installed.
## Python virtualenv
- OK: no $VIRTUAL_ENV
## Ruby provider (optional)
- INFO: Ruby: ruby 2.7.1p83 (2020-03-31 revision a0c7c23c9c) [x86_64-linux-gnu]
- INFO: Host: /usr/local/bin/neovim-ruby-host
- OK: Latest "neovim" gem is installed: 0.8.1
## Node.js provider (optional)
- INFO: Node.js: v12.18.2
- INFO: Nvim node.js host: /usr/local/lib/node_modules/neovim/bin/cli.js
- OK: Latest "neovim" npm/yarn package is installed: 4.9.0
## Perl provider (optional)
- ERROR: perl provider error:
- ADVICE:
- "Neovim::Ext" cpan module is not installed
Log (Extension Host):
[2021-03-03 17:09:43.405] [exthost] [info] extension host started
[2021-03-03 17:09:43.438] [exthost] [info] ExtensionService#_doActivateExtension vscode.microsoft-authentication {"startup":false,"extensionId":{"value":"vscode.microsoft-authentication","_lower":"vscode.microsoft-authentication"},"activationEvent":"onAuthenticationRequest:microsoft"}
[2021-03-03 17:09:43.438] [exthost] [info] ExtensionService#loadCommonJSModule file:///snap/code/55/usr/share/code/resources/app/extensions/microsoft-authentication/dist/extension.js
[2021-03-03 17:09:43.445] [exthost] [info] ExtensionService#_doActivateExtension vscode.debug-auto-launch {"startup":true,"extensionId":{"value":"vscode.debug-auto-launch","_lower":"vscode.debug-auto-launch"},"activationEvent":"*"}
[2021-03-03 17:09:43.445] [exthost] [info] ExtensionService#loadCommonJSModule file:///snap/code/55/usr/share/code/resources/app/extensions/debug-auto-launch/dist/extension
[2021-03-03 17:09:43.447] [exthost] [info] ExtensionService#_doActivateExtension vscode.git {"startup":true,"extensionId":{"value":"vscode.github","_lower":"vscode.github"},"activationEvent":"*"}
[2021-03-03 17:09:43.447] [exthost] [info] ExtensionService#loadCommonJSModule file:///snap/code/55/usr/share/code/resources/app/extensions/git/dist/main
[2021-03-03 17:09:43.460] [exthost] [info] ExtensionService#_doActivateExtension asvetliakov.vscode-neovim {"startup":true,"extensionId":{"value":"asvetliakov.vscode-neovim","_lower":"asvetliakov.vscode-neovim"},"activationEvent":"*"}
[2021-03-03 17:09:43.461] [exthost] [info] ExtensionService#loadCommonJSModule file:///home/noah/.vscode/extensions/asvetliakov.vscode-neovim-0.0.78/dist/extension.js
[2021-03-03 17:09:43.474] [exthost] [info] ExtensionService#_doActivateExtension sainnhe.gruvbox-material {"startup":true,"extensionId":{"value":"sainnhe.gruvbox-material","_lower":"sainnhe.gruvbox-material"},"activationEvent":"*"}
[2021-03-03 17:09:43.474] [exthost] [info] ExtensionService#loadCommonJSModule file:///home/noah/.vscode/extensions/sainnhe.gruvbox-material-6.3.6/out/extension.js
[2021-03-03 17:09:43.566] [exthost] [info] ExtensionService#_doActivateExtension ms-vscode.js-debug {"startup":false,"extensionId":{"value":"ms-vscode.js-debug","_lower":"ms-vscode.js-debug"},"activationEvent":"onCommand:extension.js-debug.clearAutoAttachVariables"}
[2021-03-03 17:09:43.566] [exthost] [info] ExtensionService#loadCommonJSModule file:///snap/code/55/usr/share/code/resources/app/extensions/ms-vscode.js-debug/src/extension.js
[2021-03-03 17:09:43.631] [exthost] [info] ExtensionService#_doActivateExtension vscode.github {"startup":false,"extensionId":{"value":"vscode.github","_lower":"vscode.github"},"activationEvent":"*"}
[2021-03-03 17:09:43.631] [exthost] [info] ExtensionService#loadCommonJSModule file:///snap/code/55/usr/share/code/resources/app/extensions/github/dist/extension.js
[2021-03-03 17:09:43.713] [exthost] [info] ExtensionService#_doActivateExtension vscode.github-authentication {"startup":false,"extensionId":{"value":"vscode.github-authentication","_lower":"vscode.github-authentication"},"activationEvent":"onAuthenticationRequest:github"}
[2021-03-03 17:09:43.713] [exthost] [info] ExtensionService#loadCommonJSModule file:///snap/code/55/usr/share/code/resources/app/extensions/github-authentication/dist/extension.js
[2021-03-03 17:09:53.440] [exthost] [info] ExtensionService#_doActivateExtension vscode.emmet {"startup":false,"extensionId":{"value":"vscode.emmet","_lower":"vscode.emmet"},"activationEvent":"onStartupFinished"}
[2021-03-03 17:09:53.440] [exthost] [info] ExtensionService#loadCommonJSModule file:///snap/code/55/usr/share/code/resources/app/extensions/emmet/dist/node/emmetNodeMain
[2021-03-03 17:09:53.452] [exthost] [info] ExtensionService#_doActivateExtension vscode.merge-conflict {"startup":false,"extensionId":{"value":"vscode.merge-conflict","_lower":"vscode.merge-conflict"},"activationEvent":"onStartupFinished"}
[2021-03-03 17:09:53.453] [exthost] [info] ExtensionService#loadCommonJSModule file:///snap/code/55/usr/share/code/resources/app/extensions/merge-conflict/dist/mergeConflictMain
[2021-03-03 17:09:53.456] [exthost] [info] ExtensionService#_doActivateExtension vscode.testing-editor-contributions {"startup":false,"extensionId":{"value":"vscode.testing-editor-contributions","_lower":"vscode.testing-editor-contributions"},"activationEvent":"onStartupFinished"}
[2021-03-03 17:09:53.456] [exthost] [info] ExtensionService#loadCommonJSModule file:///snap/code/55/usr/share/code/resources/app/extensions/testing-editor-contributions/dist/extension.js
[2021-03-03 17:09:59.931] [exthost] [info] ExtensionService#_doActivateExtension vscode.configuration-editing {"startup":false,"extensionId":{"value":"vscode.configuration-editing","_lower":"vscode.configuration-editing"},"activationEvent":"onLanguage:jsonc"}
[2021-03-03 17:09:59.931] [exthost] [info] ExtensionService#loadCommonJSModule file:///snap/code/55/usr/share/code/resources/app/extensions/configuration-editing/dist/configurationEditingMain
[2021-03-03 17:09:59.939] [exthost] [info] ExtensionService#_doActivateExtension vscode.json-language-features {"startup":false,"extensionId":{"value":"vscode.json-language-features","_lower":"vscode.json-language-features"},"activationEvent":"onLanguage:jsonc"}
[2021-03-03 17:09:59.940] [exthost] [info] ExtensionService#loadCommonJSModule file:///snap/code/55/usr/share/code/resources/app/extensions/json-language-features/client/dist/node/jsonClientMain
[2021-03-03 17:09:59.973] [exthost] [info] ExtensionService#_doActivateExtension vscode.typescript-language-features {"startup":false,"extensionId":{"value":"vscode.typescript-language-features","_lower":"vscode.typescript-language-features"},"activationEvent":"onLanguage:jsonc"}
[2021-03-03 17:09:59.973] [exthost] [info] ExtensionService#loadCommonJSModule file:///snap/code/55/usr/share/code/resources/app/extensions/typescript-language-features/dist/extension
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 10
- Comments: 18
Actually
/snap/bin/nvim
is just a symlink to the actualnvim
executable, for some reason VSCode has trouble with it being a symlink, but adding the real path to the executable works fine.The real path is
/snap/nvim/current/usr/bin/nvim
I have found a workaround. Instead of installing neovim via snap, I’ve downloaded a nightly release from github.
https://github.com/neovim/neovim/releases/tag/nightly
Direct link to the file: https://github.com/neovim/neovim/releases/download/nightly/nvim.appimage
I’ve downloaded it to the home folder and followed the instructions:
chmod u+x nvim.appimage
I’ve changed neovim location in vscode settings and everything works fine.
This also seems to work for me! I still don’t understand why it doesn’t work with the snap install. It should be a valid version, right? But I guess, it doesn’t matter for now. Thank you!
I have noticed the same problem, but only on ubuntu.
vscode-neovim works fine on macos. On macos I’ve installed neovim via homebrew (
brew install --HEAD neovim
).I have installed neovim on ubuntu via snap (
sudo snap install nvim --edge --classic
) and I am getting the same error message in vscode as @TheTrueBrot.My
settings.json
also hasneovim seems to work fine by itself.
I got this error because my default WSL distro was not the one on which Neovim was installed. Switching the default distro to the correct one fixed it.
wsl --set-default <Distribution Name>
This is the first solution. Thank you.
I had the same problem. Snap version is not working with VSCode plugin. As a workaround install from
.deb
Remove
snap
version:Is you installed
neovim
apt-get version 0.6 - remove that too. It leaves some leftovers, soautoremove
is mandatory, otherwise last package install will be failing:Install debian package:
After that it worked for me with latest version 😃