posit-dev / posit-dev/positron
Project Wizard: sort interpreters by version within each runtime source group
Open
Nobody has claimed this yet.
area: folder template
enhancement
- Dominant language
- TypeScript
- Stars
- 4.3k
- Forks
- 184
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 195
Description
Background
- The interpreters shown in the Python Environment Step and R Configuration Step are grouped by runtime source (e.g. Pyenv, System, Global, etc.), but not explicitly sorted by version within each group
- Generally, the dropdown list looks to be sorted as it seems interpreter discovery/registration occurs in some sort of alphabetical/numerical order
- However, it seems like sometimes the descending version order is not preserved, possibly because an interpreter gets saved as a "preferred interpreter" and its discovery and registration may be prioritized
- Update: actually it sounds like there isn't really an order, so it may just happen to be that the runtimes start in version-order much of the time https://github.com/posit-dev/positron/issues/1044#issuecomment-1675099336
- We should apply a simple sort within each runtime source group to order them by version (descending, i.e. newest version towards the top)
Example from Project Wizard Python Environment Step
Relevant Code
interpretersToDropdownItemsin interpreterDropDownUtils.ts is where we'd need to add the sorting
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in src/vs/workbench/browser/positronNewProjectWizard/utilities/interpreterDropDownUtils.ts at interpretersToDropdownItems. Trace how runtime source groups and interpreter versions are represented, then add the requested ordering within each group. Done means the Project Wizard Python and R interpreter dropdowns show newest versions first while preserving runtime source groups.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100