Repository navigation
Use shared localization submission and pull-only release imports #1971
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
base: main
Are you sure you want to change the base?
Changes from all commits
d9d04a8
95245a6
a886e0b
5e192fc
385c9c6
d333006
32c59fe
2141da2
b936289
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| name: Localization | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| push: | ||
| branches: | ||
| - main | ||
| paths: | ||
| - package.json | ||
| - package.nls.json | ||
| - src/**/*.ts | ||
| - .nvmrc | ||
| - .github/workflows/localization.yml | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| concurrency: | ||
| group: localization-${{ github.ref }} | ||
| cancel-in-progress: false | ||
|
|
||
| jobs: | ||
| localization: | ||
| if: github.repository == 'microsoft/vscode-python-environments' | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 20 | ||
| steps: | ||
| - uses: microsoft/vscode-common-python-lsp/.github/actions/localization@6b4a3573e7e7a9fe1e468e129544432278aec2d6 | ||
| with: | ||
| app-id: ${{ vars.PYTHON_LOCALIZATION_APP_ID }} | ||
| private-key: ${{ secrets.PYTHON_LOCALIZATION_PRIVATE_KEY }} | ||
| node-version: '22.21.1' |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -206,6 +206,7 @@ export class PythonEnvironmentManagers implements EnvironmentManagers { | |
| * Only mutated by setEnvironment() / setEnvironments() / refreshEnvironment(). | ||
| */ | ||
| private readonly _activeSelection = new Map<string, PythonEnvironment | undefined>(); | ||
| private _globalSelectionManagerId: string | undefined; | ||
| /** | ||
| * The last explicit selection for each scope, keyed like `_activeSelection`: the manager that stores | ||
| * it, and whether the user made it. Explicit selections are user selections and environments chosen | ||
|
|
@@ -1130,16 +1131,25 @@ export class PythonEnvironmentManagers implements EnvironmentManagers { | |
| ): 'recorded' | 'cleared' | 'kept' | 'unchanged' { | ||
| if (environment && explicit && manager.id !== INLINE_SCRIPT_MANAGER_ID) { | ||
| this._explicitSelections.set(key, { managerId: manager.id, userSelected }); | ||
| if (key === 'global') { | ||
| this._globalSelectionManagerId = manager.id; | ||
| } | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
📍 src\features\envManagers.ts:1133 [verified] |
||
| return 'recorded'; | ||
| } | ||
| const current = this._explicitSelections.get(key); | ||
| if (!current) { | ||
| if (key === 'global') { | ||
| this._globalSelectionManagerId = manager.id; | ||
| } | ||
| return 'unchanged'; | ||
| } | ||
| if (!userSelected && current.userSelected) { | ||
| return 'kept'; | ||
| } | ||
| this._explicitSelections.delete(key); | ||
| if (key === 'global') { | ||
| this._globalSelectionManagerId = getDefaultEnvManagerSetting(this.pm, undefined); | ||
| } | ||
| return 'cleared'; | ||
| } | ||
|
|
||
|
|
@@ -1239,8 +1249,15 @@ export class PythonEnvironmentManagers implements EnvironmentManagers { | |
| ? this._environmentManagers.get(cachedEnv.envId.managerId) | ||
| : undefined; | ||
|
|
||
| if (context === undefined && cachedManager && this._explicitSelections.has('global')) { | ||
| return cachedManager; | ||
| if (context === undefined && this._explicitSelections.has('global')) { | ||
| // A manager may return another manager's fallback environment; route through | ||
| // the manager that selected it, not the owner of the announced descriptor. | ||
| const globalManager = this._globalSelectionManagerId | ||
| ? this._environmentManagers.get(this._globalSelectionManagerId) | ||
| : cachedManager; | ||
| if (globalManager) { | ||
| return globalManager; | ||
| } | ||
| } | ||
|
|
||
| const defaultEnvManagerId = getDefaultEnvManagerSetting(this.pm, context); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📍 README.md:396
This paragraph permits wholly untranslated tables, while the PR’s readiness contract explicitly requires rejecting them. Reconcile the README and PR acceptance contract with the pinned importer’s intended policy; the established finding is a documentation mismatch, not a verified importer defect.
[verified]