Skip to content

Provide API to get ListRuntimes and ListSDKs output #2315

@nagilson

Description

@nagilson

Is your feature request related to a problem? Please describe.

The debugger would like to reuse our logic to get the architecture and installations so they don't use dotnet --info. We can share this info via an API available in version 2.3.7 as follows:

Command:

`dotnet.availableInstalls` 

Takes:

export interface IDotnetSearchContext :
{
mode : DotnetInstallMode // (`runtime` | `aspnetcore` | `sdk`) The 2 runtime modes behave the same and return both runtime types.
dotnetExecutablePath : string, // A full path is preferred, as 'dotnet' will fail if 'which' or 'where' is corrupted.
architecture : string | null // (accepts 'x64', 'x86', 'arm64'). Will default to the executable architecture if detectable, else the `os.arch()`.
}

Returns:
IDotnetListInfo[], empty if none found

export interface IDotnetListInfo
{
 mode: DotnetInstallMode, 
version: string, 
directory : string, 
architecture: string | null // Architecture is null if it cannot be determined, which should not happen except in cases such as: a dotnet executable built for arm32 or custom architecture such as `Silicon Graphics SVx`, or a corrupt dotnet executable.
}; 

A clear and concise description of what you want to happen. Include any alternative solutions you've considered.

Utilize our cache and architecture API to reduce load.

Describe the solution you'd like

dotnet/vscode-csharp#8370 (comment)

Additional context

cc @baronfel for FYI

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions