Skip to content

extensionId option in registerEnvManager doesn’t do anything #1483

@flying-sheep

Description

@flying-sheep

Environment data

  • Python Environments extension version: 1.28.0
  • Python extension (ms-python.python) version: irrelevant
  • VS Code version (Help → About): irrelevant
  • OS and version: irrelevant
  • Python version (& distribution if applicable, e.g. Anaconda): irrelevant
  • Environment manager in use (venv / conda / pyenv / poetry / pipenv / system / uv / other): irrelevant
  • Shell (bash / zsh / fish / pwsh / cmd / other): irrelevant
  • Remote / container scenario (none / WSL / SSH Remote / Dev Container / Codespaces): none
  • Workspace type (single folder / multi-root / mono-repo): irrelevant
  • Is this a regression? If yes, last known working extension version: no

Repro Steps

use the extensionId feature added in #1436

Expected behavior

the passed extensionId is used when the extension is loaded

Actual behavior

The env manager is registered with the wrong extension ID ms-python.vscode-python-envs.

Logs

irrelevant

Additional context

Stepping through the code, it finds these relevantFrames:

[
  {
    filePath: "~/.vscode/extensions/ms-python.vscode-python-envs-1.28.0/dist/extension.js",
    functionName: "p.registerEnvironmentManager",
  },
  {
    filePath: "~/Dev/JS/hatch-code/dist/extension.js",
    functionName: "activate",
  },
  ...
]

which are then filtered to

[
  "~/.vscode/extensions/ms-python.vscode-python-envs-1.28.0/dist/extension.js",
  "~/Dev/JS/hatch-code/dist/extension.js",
]

Which leads to the first one being picked before the code even reaches the extensionId code.

Easy fix by first checking the passed extensionId and then trying to search the stack.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions