MCPcopy
hub / github.com/PowerShell/vscode-powershell / ensureEditorServicesIsConnected

Function ensureEditorServicesIsConnected

test/utils.ts:83–89  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

81}
82
83export async function ensureEditorServicesIsConnected(): Promise<IPowerShellExtensionClient> {
84 const extension = await ensureExtensionIsActivated();
85 const sessionId = extension.registerExternalExtension(extensionId);
86 await extension.waitUntilStarted(sessionId);
87 extension.unregisterExternalExtension(sessionId);
88 return extension;
89}
90
91/**
92 * This is a workaround for sinon not being able to stub interfaces. Interfaces are a TypeScript-only concept so this effectively allows us to stub interfaces by not providing the entire implementation but only what matters for the test. "What matters" is not type checked so you must be careful to stub everything you need, otherwise you should provide a default implementation instead if you do not know.

Callers 1

Calls 4

waitUntilStartedMethod · 0.65

Tested by

no test coverage detected