Vscode-neovim: Feature request: New install experience

Created on 22 Feb 2020  Â·  3Comments  Â·  Source: asvetliakov/vscode-neovim

I would like to improve on the first-install experience.

  1. Have vscode-neovim.neovimPath be 'nvim' and search $PATH for it by default.
  2. If nvim is found but have the wrong version. ERROR OUT and show an error on start.

This plugin requires me to always open up the config to use the tool when I install vscode with the neovim ext. on a new computer. Which I do.. often! And equally often I will screw up on the configuration and wonder why all keyboard input is being dropped. After several restarts and WTFs I realize that "oh its called nvim not neovim" or "oh neovim was old on this system I need to install it out of tree" or something else.

enhancement

Most helpful comment

I've been thinking it would be nice for Nvim clients like https://github.com/neovim/node-client and https://github.com/neovim/pynvim to have a "find nvim" function, since this is a very common need.

All 3 comments

The resolve-path semantics requires that 1) check if program is an absolute path 2) check if it is available in $PATH

➜  PATH=/bin type /bin/ls 
/bin/ls is /bin/ls
➜  PATH=/bin type ls
ls is /bin/ls
➜  PATH=/bin type nvim
nvim is /bin/nvim
➜  PATH=/bin type /usr/bin/nvim
/usr/bin/nvim not found

Checking for absolute paths should be a one line thing with node's path module

As for checking in $PATH I'm not sure, but there's this

You have a good idea here though. The install experience could be improved as the user can be in the dark from time to time about what's happening. I'm currently working on a feature related to paths (splitting neovimPath into neovimPath.windows, neovimPath.linux etc) so if you'd like to see the code that's related to the paths check out #157

Based on what OP said, here are the scenarios to consider:

  • Path to executable is not provided
    What happens now: You get an error saying "Set neovim path and restart editor"
    What would be better: Add a button to the popup that redirects you to User Settings and highlights that input box? Not sure if that's possible. If it's possible we could auto-find that path if it's not set, then write it to settings automatically. + we could reword the error message to "press CTRL+SHIFT+P and Reload Window", the user doesn't really need to ALT+F4 out of vscode
  • Path is provided but it points to a file that doesn't exist
    What happens now: Popup with internal vscode error is shown: Activating extension 'asvetliakov.vscode-neovim' failed: Cannot call write after a stream was destroyed. It's impossible to write anything, even using regular vscode way of typing
    What would be better: Error popup saying that the file doesn't exist. Add a button to the popup that redirects to settings and highlights the input box of the path if possible

Some other cases:

  • user selected useWSL but doesn't have WSL (eg. has WSL on another computer but forgot to install it here)
  • correct path is provided but neovim is too old
  • user provides path that contains spaces (eg. C:/Program Files), not sure what happens then

I'm wondering if it's possible to watch changes to settings.json and auto-retry connecting to nvim eg. when user changes a path

EDIT: Opening settings with a predefined query is possible

EDIT: just spent 20 mins figuring out what's wrong with vscode-neovim on a new install (it wasnt working, no errrors) because the path I provided was /usr/bin/nivm (not nvim)

I've been thinking it would be nice for Nvim clients like https://github.com/neovim/node-client and https://github.com/neovim/pynvim to have a "find nvim" function, since this is a very common need.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

asvetliakov picture asvetliakov  Â·  5Comments

Liquidmantis picture Liquidmantis  Â·  3Comments

ppwwyyxx picture ppwwyyxx  Â·  4Comments

kkorus picture kkorus  Â·  4Comments

trkoch picture trkoch  Â·  3Comments