Skip to content

Commit a696dd0

Browse files
author
Kartik Raj
committed
Add documentation
1 parent 189e7d8 commit a696dd0

File tree

1 file changed

+42
-1
lines changed

1 file changed

+42
-1
lines changed

src/client/proposedApiTypes.ts

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,32 +70,69 @@ interface IEnvironmentLocatorAPI {
7070
*
7171
* Note this can be expensive so it's best to only use it if user manually triggers it. For
7272
* internal automatic triggers consider using {@link RefreshOptions.ifNotRefreshedAlready}.
73-
* @param options Additonal options for refresh.
73+
* @param options Additional options for refresh.
7474
* @param token A cancellation token that indicates a refresh is no longer needed.
7575
*/
7676
refreshEnvironment(options: RefreshOptions, token?: CancellationToken): Promise<void>;
7777
}
7878

79+
/**
80+
* Details about the environment. Note the type, name and environment path is known.
81+
*/
7982
export interface Environment {
8083
pathID: UniquePathType;
84+
/**
85+
* Carries details about python executable.
86+
*/
8187
executable: {
88+
/**
89+
* Path to the python interpreter/executable. Carries `undefined` in case an executable does not belong to the environment.
90+
*/
8291
path: string | undefined;
92+
/**
93+
* Bitness if known at this moment.
94+
*/
8395
bitness: Architecture | undefined;
96+
/**
97+
* Value of `sys.prefix` in sys module if known at this moment.
98+
*/
8499
sysPrefix: string | undefined;
85100
};
101+
/**
102+
* Carries details if it is an environment, otherwise `undefined` in case of global interpreters or something else.
103+
*/
86104
environment:
87105
| {
106+
/**
107+
* Type of the environment. This never changes over time.
108+
*/
88109
type: EnvType;
110+
/**
111+
* Name to the environment if any.
112+
*/
89113
name: string | undefined;
114+
/**
115+
* Path to the environment folder.
116+
*/
90117
folderPath: string;
91118
/**
92119
* Any specific workspace folder this environment is created for.
93120
*/
94121
workspaceFolder: Uri | undefined;
122+
/**
123+
* Tools/Plugins which created the environment or where it came from in the order.
124+
* First value corresponds to the primary source, which never changes over time.
125+
*/
95126
source: EnvSource[];
96127
}
97128
| undefined;
129+
/**
130+
* Carries Python version information.
131+
*/
98132
version: StandardVersionInfo & {
133+
/**
134+
* Value of `sys.version` in sys module if known at this moment.
135+
*/
99136
sysVersion: string | undefined;
100137
};
101138
}
@@ -120,6 +157,10 @@ export interface ResolvedEnvironment {
120157
}
121158

122159
export type ProgressNotificationEvent = {
160+
/**
161+
* * started: Fires when a refresh is started.
162+
* * finished: Fires when a refresh is over.
163+
*/
123164
stage: 'started' | 'finished';
124165
};
125166

0 commit comments

Comments
 (0)