Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set shell and env for ASDF activation #2006

Merged
merged 3 commits into from
May 30, 2024
Merged

Set shell and env for ASDF activation #2006

merged 3 commits into from
May 30, 2024

Conversation

vinistock
Copy link
Member

@vinistock vinistock commented May 2, 2024

Motivation

Closes #1999, closes #1997, closes #2048, closes #2023

It might also do it for #2027, #1517 and #2020

Our ASDF integration was broken for two main reasons: ASDF depends on the user's shell and on a bunch of environment variables to properly activate. This is why we had to set the data dir manually, when in fact ASDF should be detecting that automatically.

Note that we may still need to offer settings for users to override ASDF_DIR and ASDF_DATA_DIR manually since ASDF does allow that and we're not sourcing their ~/.zshrc or ~/.bashrc files.

Implementation

  1. Started setting the shell to be vscode.env.shell, which should match what the user configured for VS Code's integrated terminal
  2. Started passing the process.env so that ASDF can use $HOME, $PATH and all other environment variables it needs to figure things out

I verified on a Linux machine that this works without having to specify ASDF_DIR or ASDF_DATA_DIR and without having to modify the PATH to include the shims directory (since ASDF is doing that on its own).

Automated Tests

Updated the tests.

Manual Tests

  1. Launch the extension in development mode on this branch
  2. Ensure the version manager is configured to be ASDF
  3. Ensure that the Ruby LSP server is launched properly using the expected Ruby version

@vinistock vinistock added bugfix This PR will fix an existing bug vscode This pull request should be included in the VS Code extension's release notes labels May 2, 2024
@vinistock vinistock self-assigned this May 2, 2024
@vinistock vinistock changed the title Set shell for executing manager activation Set shell and env for ASDF activation May 29, 2024
@vinistock vinistock marked this pull request as ready for review May 29, 2024 19:59
@vinistock vinistock requested a review from a team as a code owner May 29, 2024 19:59
@vinistock vinistock requested review from andyw8 and st0012 May 29, 2024 19:59
@vinistock vinistock merged commit 49e3dff into main May 30, 2024
33 checks passed
@vinistock vinistock deleted the vs/set_shell branch May 30, 2024 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix This PR will fix an existing bug vscode This pull request should be included in the VS Code extension's release notes
Projects
None yet
3 participants