@@ -21,7 +21,7 @@ import { FolderContext } from "@src/FolderContext";
2121import { FolderOperation , WorkspaceContext } from "@src/WorkspaceContext" ;
2222import configuration from "@src/configuration" ;
2323import { getLLDBLibPath } from "@src/debugger/lldb" ;
24- import { Api } from "@src/extension" ;
24+ import { InternalApi } from "@src/extension" ;
2525import { SwiftLogger } from "@src/logging/SwiftLogger" ;
2626import { buildAllTaskName , resetBuildAllTaskCache } from "@src/tasks/SwiftTaskProvider" ;
2727import { Extension } from "@src/utilities/extensions" ;
@@ -103,15 +103,15 @@ function configureLogDumpOnTimeout(timeout: number, logger: ExtensionActivationL
103103}
104104
105105const extensionBootstrapper = ( ( ) => {
106- let activatedAPI : Api | undefined = undefined ;
106+ let activatedAPI : InternalApi | undefined = undefined ;
107107 const testTitle = ( currentTest : Mocha . Test ) => currentTest . titlePath ( ) . join ( " → " ) ;
108108 let activationLogger : ExtensionActivationLogger ;
109109 let logOnError : < T > ( prefix : string , work : ( ) => Thenable < T > | T ) => Promise < T > ;
110110
111111 function testRunnerSetup (
112112 before : Mocha . HookFunction ,
113113 setup :
114- | ( ( this : Mocha . Context , api : Api ) => Promise < ( ( ) => Promise < void > ) | void > )
114+ | ( ( this : Mocha . Context , api : InternalApi ) => Promise < ( ( ) => Promise < void > ) | void > )
115115 | undefined ,
116116 after : Mocha . HookFunction ,
117117 teardown : ( ( this : Mocha . Context ) => Promise < void > ) | undefined ,
@@ -297,26 +297,26 @@ const extensionBootstrapper = (() => {
297297
298298 return {
299299 // Activates the extension and adds the defaultPackage to the workspace.
300- // We can only truly call `vscode.Extension<Api >.activate()` once for an entire
300+ // We can only truly call `vscode.Extension<InternalApi >.activate()` once for an entire
301301 // test run, so after it is called once we switch over to calling activate on
302302 // the returned API object which behaves like the extension is being launched for
303303 // the first time _as long as everything is disposed of properly in `deactivate()`_.
304- async activateExtension ( testAssets ?: string [ ] , callSite ?: Error ) : Promise < Api > {
304+ async activateExtension ( testAssets ?: string [ ] , callSite ?: Error ) : Promise < InternalApi > {
305305 const extensionId = "swiftlang.swift-vscode" ;
306- const ext = vscode . extensions . getExtension < Api > ( extensionId ) ;
306+ const ext = vscode . extensions . getExtension < InternalApi > ( extensionId ) ;
307307 if ( ! ext ) {
308308 throw new Error ( `Unable to find extension "${ extensionId } "` ) ;
309309 }
310310
311311 // We can only _really_ call activate through
312- // `vscode.extensions.getExtension<Api >("swiftlang.swift-vscode")` once.
312+ // `vscode.extensions.getExtension<InternalApi >("swiftlang.swift-vscode")` once.
313313 // Subsequent activations must be done through the returned API object.
314314 if ( ! activatedAPI ) {
315315 activationLogger . info (
316316 "Performing the one and only extension activation for this test run."
317317 ) ;
318318 for ( const depId of [ Extension . CODELLDB , Extension . LLDBDAP ] ) {
319- const dep = vscode . extensions . getExtension < Api > ( depId ) ;
319+ const dep = vscode . extensions . getExtension < InternalApi > ( depId ) ;
320320 if ( ! dep ) {
321321 throw new Error ( `Unable to find extension "${ depId } "` ) ;
322322 }
@@ -418,7 +418,10 @@ const extensionBootstrapper = (() => {
418418 } ,
419419
420420 activateExtensionForSuite : function ( config ?: {
421- setup ?: ( this : Mocha . Context , api : Api ) => Promise < ( ( ) => Promise < void > ) | void > ;
421+ setup ?: (
422+ this : Mocha . Context ,
423+ api : InternalApi
424+ ) => Promise < ( ( ) => Promise < void > ) | void > ;
422425 teardown ?: ( this : Mocha . Context ) => Promise < void > ;
423426 testAssets ?: string [ ] ;
424427 requiresLSP ?: boolean ;
@@ -436,7 +439,10 @@ const extensionBootstrapper = (() => {
436439 } ,
437440
438441 activateExtensionForTest : function ( config ?: {
439- setup ?: ( this : Mocha . Context , api : Api ) => Promise < ( ( ) => Promise < void > ) | void > ;
442+ setup ?: (
443+ this : Mocha . Context ,
444+ api : InternalApi
445+ ) => Promise < ( ( ) => Promise < void > ) | void > ;
440446 teardown ?: ( this : Mocha . Context ) => Promise < void > ;
441447 testAssets ?: string [ ] ;
442448 requiresLSP ?: boolean ;
0 commit comments