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

vscode/asdf: search the default XDG base data directory #2045

Closed
wants to merge 2 commits into from
Closed

vscode/asdf: search the default XDG base data directory #2045

wants to merge 2 commits into from

Conversation

gi
Copy link

@gi gi commented May 13, 2024

This updates the detection of the asdf data directory for setting the environment variable ASDF_DATA_DIR during activation.

Fixes #2023

Motivation

Fixes #2023

The XDG base directory specification is becoming more popular in outside of Linux. The default base data directory is ~/.local/share where applications store their user data within a directory under the base: e.g. ~/.local/share/asdf.

Implementation

This update includes the XDG base data directory in the list when detecting the location for activation.

Automated Tests

Yes.

Manual Tests

  1. Create the directory ~/.local/share/asdf/shims
  2. Start VS Code
  3. Open Ruby file

@gi gi requested a review from a team as a code owner May 13, 2024 06:10
@gi gi requested review from andyw8 and vinistock May 13, 2024 06:10
@@ -51,8 +51,19 @@ export class Asdf extends VersionManager {
// file, but that may not be the case for a Homebrew installation, in which case the we'd have
// `/opt/homebrew/opt/asdf/libexec/asdf.sh`, but the data directory might be `~/.asdf`
async findAsdfDataDir(): Promise<vscode.Uri> {
// In order, the data locations are:
// 1. Default
Copy link
Contributor

@andyw8 andyw8 May 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(nit) If we assign each possible path to a variable, then we could avoid the need for this comment.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah. I copied this from the other method, but it can easily be removed if not helpful.

@andyw8
Copy link
Contributor

andyw8 commented May 13, 2024

(the rest of the team is at RubyKaigi so there might be a little delay until we ship this)

This updates the detection of the asdf data directory for setting
the environment variable `ASDF_DATA_DIR` during activation.

Fixes #2023
@gi
Copy link
Author

gi commented May 20, 2024

Just bumping this and wondering if the tests could be run so that this is ready to go when reviewed and if approved.

@andyw8
Copy link
Contributor

andyw8 commented May 21, 2024

Triggered the tests.

@vinistock
Copy link
Member

@gi I shipped a few improvements to the ASDF implementation which should fix many of the issues we were seeing before. I think this PR can just add the .local/share directory to the list and that should be good 👍.

@gi
Copy link
Author

gi commented May 30, 2024

@vinistock I just tested the latest version, and the changes work on my machine. Thanks for updating. I'm going to close this as the changes are no longer needed.

The issue was fixed by #2006

@gi gi closed this May 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

vs code: asdf environment variables ignored
3 participants