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

Warn users if shadownev is not installed #2498

Merged
merged 1 commit into from
Aug 28, 2024

Conversation

vinistock
Copy link
Member

Motivation

We received an interesting report where activating the Ruby environment with shadowenv was failing. It turned out that it was not failing because the workspace was untrusted, but because the extension couldn't find the shadowenv executable because sourcing the user's ~/.zshrc was taking too long and exceeded VS Code's timeout for launching the shell.

The problem ended up being more confusing than it had to be because we always assume that any Shadowenv failures are because the workspace is untrusted.

This PR just adds a custom error for when Shadowenv is not found, so that users are better informed of why it failed.

Implementation

Started checking the error message. Each shell shows a different message when an executable is not available, so I tried to go for a catch all implementation.

Automated Tests

The Shadowenv tests were both brittle and a bit redundant, so I did a little bit of restructuring and added a new example.

@vinistock vinistock added enhancement New feature or request vscode This pull request should be included in the VS Code extension's release notes labels Aug 27, 2024
@vinistock vinistock self-assigned this Aug 27, 2024
@vinistock vinistock requested a review from a team as a code owner August 27, 2024 21:11
@vinistock vinistock requested review from andyw8 and st0012 August 27, 2024 21:11
Copy link
Contributor

@egiurleo egiurleo left a comment

Choose a reason for hiding this comment

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

shadowenv strikes again!

vscode/src/test/suite/ruby/shadowenv.test.ts Outdated Show resolved Hide resolved
@vinistock vinistock force-pushed the vs-improve-shadowenv-message branch from c9934dd to 62273ff Compare August 28, 2024 13:21
@vinistock vinistock force-pushed the vs-improve-shadowenv-message branch from 62273ff to d2ff522 Compare August 28, 2024 13:42
@vinistock vinistock merged commit 421e879 into main Aug 28, 2024
33 checks passed
@vinistock vinistock deleted the vs-improve-shadowenv-message branch August 28, 2024 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request vscode This pull request should be included in the VS Code extension's release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants