Skip to content

Do not attempt to launch any servers in case when Python is not installed #25

@karrtikr

Description

@karrtikr

Something like:

public async hasInterpreters(): Promise<boolean> {
    const onAddedToCollection = createDeferred();
    // Watch for collection changed events.
    this.api.onChanged(async (e: PythonEnvCollectionChangedEvent) => {
        if (e.new) {
            onAddedToCollection.resolve();
        }
    });
    const initialEnvs = this.api.getEnvs();
    if (initialEnvs.length > 0) {
        return true;
    }
    await Promise.race([onAddedToCollection.promise, this.api.getRefreshPromise()]);
    return this.api.getEnvs().length > 0;
}

can be built off using the proposed discovery API.

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature-requestRequest for new features or functionality

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions