posit-dev / posit-dev/positron
Language Runtime enums must exist in too many places
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 4.3k
- Forks
- 183
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 206
Description
The enums associated with the Language Runtime API need to exist in the vscode.d.ts type definitions, so extension authors can build on them.
Hygiene rules ensure that types that exist on the external API must also exist on the extension host, so we have to copy this to extHostTypes.
Other rules forbid the importing of any types from vscode API or extHost (which represent the extension host process) into the core/contrib code. So we have to define the enum a third time there for use inside the core.
It feels like there ought to be a way for us to reduce this to two type declarations, or even one.
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 by comparing the three enum declarations in src/vscode-dts/vscode.d.ts, src/vs/workbench/api/common/extHostTypes.ts, and src/vs/workbench/contrib/languageRuntime/common/languageRuntimeService.ts. Trace the import restrictions described in the issue and determine whether a shared declaration can satisfy the external API, extension host, and core users. Done means reducing duplication without importing vscode or extHost types into core/contrib code.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- developer-experience
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100