Skip to content

Language Runtime enums must exist in too many places #12

@jmcphers

Description

@jmcphers

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.

https://github.com/rstudio/myriac/blob/87d043fa70b8734129f733865d420d9f31fca04d/src/vscode-dts/vscode.d.ts#L16447-L16457

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.

https://github.com/rstudio/myriac/blob/87d043fa70b8734129f733865d420d9f31fca04d/src/vs/workbench/api/common/extHostTypes.ts#L3899-L3909

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.

https://github.com/rstudio/myriac/blob/87d043fa70b8734129f733865d420d9f31fca04d/src/vs/workbench/contrib/languageRuntime/common/languageRuntimeService.ts#L33-L42

It feels like there ought to be a way for us to reduce this to two type declarations, or even one.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: apiIssues related to API category.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions