Commit b893232
Fix path-only Python project manager defaults (#1667)
## Summary
Fixes #1666.
Path-only entries are valid according to the
`python-envs.pythonProjects` setting schema:
```json
{
"python-envs.pythonProjects": [
{
"path": "backend"
}
]
}
```
However, the manager-setting helpers called `.length` on the omitted
`envManager` and `packageManager` properties. This caused repeated
`TypeError` failures during post-initialization telemetry and
environment lookup.
## Fix
- Treat omitted or empty project-level manager values as requests to use
the corresponding default setting.
- Mark `PythonProjectSettings.envManager` and `.packageManager` optional
so the internal type matches the contributed JSON schema.
- Add a unit test covering a path-only nested project entry and both
default-manager fallbacks.
## Validation
- Reproduced with VS Code 1.130.0 and the latest stable extensions in an
empty `--user-data-dir` / `--extensions-dir` profile.
- Installed the patched 1.37.0 VSIX in a second empty profile and
verified that the same workspace starts without `TypeError` or
post-initialization failure.
- `npm run compile-tests`
- `npm run lint`
- `npm run unittest` — 1,429 passing, 6 pending
AI disclosure: Prepared with assistance from OpenAI Codex.
Co-authored-by: Eduardo Villalpando Mello <eduardovil@microsoft.com>1 parent ab7e086 commit b893232
3 files changed
Lines changed: 65 additions & 4 deletions
File tree
- src
- features
- settings
- test/features/settings
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
41 | | - | |
| 40 | + | |
| 41 | + | |
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
102 | | - | |
| 102 | + | |
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
| |||
127 | 127 | | |
128 | 128 | | |
129 | 129 | | |
130 | | - | |
| 130 | + | |
131 | 131 | | |
132 | 132 | | |
133 | 133 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
| 13 | + | |
12 | 14 | | |
13 | 15 | | |
14 | 16 | | |
| |||
35 | 37 | | |
36 | 38 | | |
37 | 39 | | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
38 | 99 | | |
39 | 100 | | |
40 | 101 | | |
| |||
0 commit comments