Repository navigation
fix: show views and commands when useEnvironmentsExtension is unset (Fixes #1892) - #2056
Open
TEJA P C (PCTEJA) wants to merge 1 commit into
Open
TEJA P C (PCTEJA) wants to merge 1 commit into
TEJA P C (PCTEJA) wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1892
When
python.useEnvironmentsExtensionis not set, the extension activates (it only skips activation on an explicitfalse), but its activity bar container, both views, and 8 Command Palette commands stayed hidden. Theirwhenclauses usedconfig.python.useEnvironmentsExtension != false, which VS Code evaluates as a truthiness check, and the setting is unregistered (undefined) without the Python extension, or defaults tofalseoutside the experiment.Changes:
activate()now publishes the decision it already makes as a context key,pythonEnvs.enabled, right after theisEnvironmentsExtensionEnabled()guard passes.whenclauses in package.json now use that key, OR-ed with the raw setting value:pythonEnvs.enabled || config.python.useEnvironmentsExtension. The raw value is truthy only when the setting is explicitly (or experimentally)true, so commands such as Create New Project from Template stay visible before activation in that case, while an explicitfalsekeeps everything hidden and an unset setting shows the UI once the extension activates.src/test/enabledContext.unit.test.tsassert that no clause uses the!= falseform and that the view container, both views, the gated command contributions, and the 8 palette entries follow the context key.Testing:
npm run compile(webpack) succeeds and eslint is clean on the changed files.