Vscode-neovim: Allow installation on Github Codespaces

Created on 12 May 2020  路  8Comments  路  Source: asvetliakov/vscode-neovim

Hello!

I'd like to try this plugin on Github Codespaces, but the extension says it cannot be installed on the server.

I'm guessing (hoping) maybe it could work like how it works with WSL?

Pretty please with a cherry on top! <3

enhancement

Most helpful comment

Mind to write guide how to do it ?

Sure. I don't really know much about codespaces, and their documentation is pretty vast, but this is what I understand.

When you create a codespace, it launches a docker environment. The image and configuration for the environment is determined from the first of these it can find:

  • .devcontainer/devcontainer.json in the repo being opened in the codespace. This can point to a Dockerfile in the repo.
  • a devcontainer.json in the user's dotfiles repo

If it can't find any of those, it uses a default debian image.

So, to install neovim, you can install using apt in the command line in the integrated terminal, or you can add it a step in the Dockerfile in the repo being opened or the user's dotfiles.

I found it was easier to install neovim in ubuntu than debian, so really all you need in the dockerfile is FROM ubuntu:20.04 and the neovim install steps.

Does it support github codeactions?

Not sure, I don't know much about codeactions either. It looks like the action you linked installs vim into the environment which was launched from an image. At a quick look I didn't see a way to use a github action to setup a docker image. I think you might just need to have the manual steps to install neovim in the image.

Edit:
Just to be clear, it's the user that has to set up their codespace and install neovim in it. If you wanted this plugin to work in a codespace by only installing this plugin, you need to do what I suggested above. Honestly, I don't think updating neovim from github releases would be that bad, the user could opt into automatic updates, or choose to use the neovim from their machine. I have quite a few plugins like I listed above that ever so often ask me if I want to update the binaries, I know the release rate of neovim nightly is fast, but it's showing up in apt every week anyways. You could also make it so users can choose a monthly/weekly update.

All 8 comments

Github codespaces should support installing neovim binaries to communicate locally within same container. I guess that's not the case currently. Unfortunately there are no other ways here.

Yesterday I got this plugin to work inside codespaces, inside the browser!
Codespaces are basically a docker image environment, so it is totally possible to install nvim on the server. You can open the integrated terminal and install from there, or you can install neovim as part of the codespace creation configuration.

However, as per OP, the extension says it cannot be installed in codespaces. This is because for some reason codespaces does not support ui-only extensions. All I had to do was change the extension type in package.json to something other than ui and it let me install it!

@theol0403 That's awesome! Mind to write guide how to do it ? I think we can add "workspace" to extension kind then to support this scenario

Even better, this plugin could do like some others do (tabnine, clangd, rust-analyser, etc) and automatically bundle/install the required binaries. Tabnine bundles the binary, and the other two directly download and update from github releases.

and the other two directly download and update from github releases.

We can't do it till stable 0.5 release: downloading nightly every time is no-way and keeping single nightly version is no-way too

or you can install neovim as part of the codespace creation configuration.

Never tried codespaces. Does it support github codeactions? If so it can use https://github.com/rhysd/action-setup-vim then

Mind to write guide how to do it ?

Sure. I don't really know much about codespaces, and their documentation is pretty vast, but this is what I understand.

When you create a codespace, it launches a docker environment. The image and configuration for the environment is determined from the first of these it can find:

  • .devcontainer/devcontainer.json in the repo being opened in the codespace. This can point to a Dockerfile in the repo.
  • a devcontainer.json in the user's dotfiles repo

If it can't find any of those, it uses a default debian image.

So, to install neovim, you can install using apt in the command line in the integrated terminal, or you can add it a step in the Dockerfile in the repo being opened or the user's dotfiles.

I found it was easier to install neovim in ubuntu than debian, so really all you need in the dockerfile is FROM ubuntu:20.04 and the neovim install steps.

Does it support github codeactions?

Not sure, I don't know much about codeactions either. It looks like the action you linked installs vim into the environment which was launched from an image. At a quick look I didn't see a way to use a github action to setup a docker image. I think you might just need to have the manual steps to install neovim in the image.

Edit:
Just to be clear, it's the user that has to set up their codespace and install neovim in it. If you wanted this plugin to work in a codespace by only installing this plugin, you need to do what I suggested above. Honestly, I don't think updating neovim from github releases would be that bad, the user could opt into automatic updates, or choose to use the neovim from their machine. I have quite a few plugins like I listed above that ever so often ask me if I want to update the binaries, I know the release rate of neovim nightly is fast, but it's showing up in apt every week anyways. You could also make it so users can choose a monthly/weekly update.

Any chance this could be addressed? I've got a working codespaces container with neovim installed, and the only thing preventing me from using this extension on codespaces is this issue 馃槃

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Liquidmantis picture Liquidmantis  路  3Comments

bogdan0083 picture bogdan0083  路  4Comments

pieterdd picture pieterdd  路  4Comments

kkorus picture kkorus  路  4Comments

DrakeXiang picture DrakeXiang  路  4Comments