Skip to content
This repository was archived by the owner on Nov 18, 2022. It is now read-only.

Commit ad59173

Browse files
committed
Declare and return a public API from the extension
1 parent 7d6f00b commit ad59173

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/extension.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,15 @@ interface ProgressParams {
4545
done?: boolean;
4646
}
4747

48-
export async function activate(context: ExtensionContext) {
48+
/**
49+
* External API as exposed by the extension. Can be queried by other extensions
50+
* or by the integration test runner for VSCode extensions.
51+
*/
52+
export interface Api {
53+
activeWorkspace: typeof activeWorkspace;
54+
}
55+
56+
export async function activate(context: ExtensionContext): Promise<Api> {
4957
context.subscriptions.push(
5058
...[
5159
configureLanguage(),
@@ -84,6 +92,8 @@ export async function activate(context: ExtensionContext) {
8492
return;
8593
});
8694
}
95+
96+
return { activeWorkspace };
8797
}
8898

8999
export async function deactivate() {

0 commit comments

Comments
 (0)