Commit e572f08
## Summary
Adds `@remarks` JSDoc sections to all methods on the
`EnvironmentManager` interface, documenting **which user actions or
internal events trigger each method**. Changes are documentation-only —
no functional changes.
## Motivation
Raised in #378: third-party extension authors implementing
`EnvironmentManager` know *what* each method does (the existing JSDoc
covers that), but not *when* or *why* it gets called. For example,
`get()` is described as "retrieves the current Python environment" — but
there's no mention that it's called at extension startup, during
terminal activation, before script execution, etc.
This makes it hard for authors to reason about their implementation.
They end up guessing at lifecycle behavior, which leads to bugs (e.g.,
not caching in `get()` because they didn't realize it's called
frequently).
## What's added
`@remarks` sections on 8 methods of `EnvironmentManager` in both
`src/api.ts` and `pythonEnvironmentsApi/src/main.ts`:
| Method | Trigger summary |
|--------|----------------|
| `create` | "Create Environment" command, "+" button in tree view, new
package project wizard |
| `remove` | Right-click → "Delete Environment" in tree view |
| `refresh` | Refresh button in the Python Environments view title bar |
| `getEnvironments` | Tree view expansion, environment picker,
internally after `refresh` |
| `set` | Environment picker selection, checkmark button in tree view,
auto-select after create, startup caching, project removal |
| `get` | Startup, after `set`, terminal activation, script execution,
picker display, auto-discovery |
| `resolve` | File picker interpreter selection,
`defaultInterpreterPath` resolution, pre-run resolution |
| `clearCache` | "Python: Clear Cache" command |
Each remark was verified by tracing every call site through
`InternalEnvironmentManager` → `envManagers.ts` → `envCommands.ts` →
`extension.ts` command registrations and `package.json` menu
contributions.
## Who this helps
Extension authors building environment managers for tools like Hatch,
Pixi, uv, etc. They can now hover over any `EnvironmentManager` method
in their IDE and see exactly what user actions will invoke it, making
implementation decisions much clearer.
## Files changed
- `src/api.ts` — internal API copy (+45 lines, documentation only)
- `pythonEnvironmentsApi/src/main.ts` — published API package (+45
lines, documentation only)
Refs #378
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 69be6a4 commit e572f08
2 files changed
Lines changed: 106 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
343 | 343 | | |
344 | 344 | | |
345 | 345 | | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
346 | 354 | | |
347 | 355 | | |
348 | 356 | | |
| |||
396 | 404 | | |
397 | 405 | | |
398 | 406 | | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
399 | 412 | | |
400 | 413 | | |
401 | 414 | | |
402 | 415 | | |
403 | 416 | | |
404 | 417 | | |
405 | 418 | | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
406 | 423 | | |
407 | 424 | | |
408 | 425 | | |
409 | 426 | | |
410 | 427 | | |
411 | 428 | | |
412 | 429 | | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
413 | 434 | | |
414 | 435 | | |
415 | 436 | | |
416 | 437 | | |
417 | 438 | | |
418 | 439 | | |
419 | 440 | | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
420 | 445 | | |
421 | 446 | | |
422 | 447 | | |
| |||
430 | 455 | | |
431 | 456 | | |
432 | 457 | | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
433 | 466 | | |
434 | 467 | | |
435 | 468 | | |
436 | 469 | | |
437 | 470 | | |
438 | 471 | | |
439 | 472 | | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
440 | 479 | | |
441 | 480 | | |
442 | 481 | | |
| |||
456 | 495 | | |
457 | 496 | | |
458 | 497 | | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
459 | 506 | | |
460 | 507 | | |
461 | 508 | | |
462 | 509 | | |
463 | 510 | | |
464 | 511 | | |
465 | 512 | | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
466 | 519 | | |
467 | 520 | | |
468 | 521 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
337 | 337 | | |
338 | 338 | | |
339 | 339 | | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
340 | 348 | | |
341 | 349 | | |
342 | 350 | | |
| |||
390 | 398 | | |
391 | 399 | | |
392 | 400 | | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
393 | 406 | | |
394 | 407 | | |
395 | 408 | | |
396 | 409 | | |
397 | 410 | | |
398 | 411 | | |
399 | 412 | | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
400 | 417 | | |
401 | 418 | | |
402 | 419 | | |
403 | 420 | | |
404 | 421 | | |
405 | 422 | | |
406 | 423 | | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
407 | 428 | | |
408 | 429 | | |
409 | 430 | | |
410 | 431 | | |
411 | 432 | | |
412 | 433 | | |
413 | 434 | | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
414 | 439 | | |
415 | 440 | | |
416 | 441 | | |
| |||
424 | 449 | | |
425 | 450 | | |
426 | 451 | | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
427 | 460 | | |
428 | 461 | | |
429 | 462 | | |
430 | 463 | | |
431 | 464 | | |
432 | 465 | | |
433 | 466 | | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
434 | 473 | | |
435 | 474 | | |
436 | 475 | | |
| |||
450 | 489 | | |
451 | 490 | | |
452 | 491 | | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
453 | 500 | | |
454 | 501 | | |
455 | 502 | | |
456 | 503 | | |
457 | 504 | | |
458 | 505 | | |
459 | 506 | | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
460 | 513 | | |
461 | 514 | | |
462 | 515 | | |
| |||
0 commit comments