helix icon indicating copy to clipboard operation
helix copied to clipboard

[feature] Devcontainers support

Open IgnisDa opened this issue 2 years ago • 4 comments

Hello. Thank you developers and awesome project!

It would be really great if helix support developing in devcontainers (either in core or via plugins). A lot of developers prefer not to clutter their systems with language tools (like rust-analyzer), and devcontainers does really well in addressing.

Looking at it from a surface level, it should be doable. Devcontainers has a CLI that can be packaged and installed once this PR lands.

Helix itself can be run similar to how their vim example works.

Would be great if you could tell me the viability of this feature. Thanks!

IgnisDa avatar Jan 09 '23 03:01 IgnisDa

Duplicate of https://github.com/helix-editor/helix/issues/3002

kirawi avatar Jan 09 '23 05:01 kirawi

@kirawi The above issue runs the LSP inside a container. The feature I want support for runs Helix in the container too. Thus I do not think this is a duplicate.

IgnisDa avatar Jan 09 '23 06:01 IgnisDa

After some hacking, here is the progress I made:

  • The base image is taken from this branch
  • The changes required to my existing devcontainer are in this branch

To get it running, clone the repo in step 1, checkout the correct branch and then run the command in docker/README.md. Then clone repo in step 2, checkout correct branch and run ./.helix/start.sh. ~It will prompt you for a password, type password there~ and helix should run. I have already installed rust-analyzer in the image so the project should open up with a working LSP.

Things that need to be figured out here:

  • [x] Remove password prompt. The scripts are taken from here but the password prompt still comes up. (fixed in https://github.com/IgnisDa/rust-libs/commit/043bb64ca79b3e0d166930c2082c56a0d6772793)
  • [ ] Figure out how to forward github credentials. Forwarding SSH credentials seem to be straightforward (tutorial here). But I use gh auth login and would like the same credentials to work.

IgnisDa avatar Jan 09 '23 06:01 IgnisDa

I made a pubic gist with info on how to get basic devcontainer support working: https://gist.github.com/IgnisDa/f4c1ffb3b798686df3193a80cbd5b3eb.

IgnisDa avatar Jan 11 '23 03:01 IgnisDa