Skip to content

Commit fee6a2f

Browse files
authored
Use extensionUrl instead of extensionPath (microsoft#19122)
1 parent 2164f56 commit fee6a2f

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

src/client/browser/extension.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,20 +45,18 @@ async function runPylance(
4545
context: vscode.ExtensionContext,
4646
pylanceExtension: vscode.Extension<unknown>,
4747
): Promise<void> {
48-
const { extensionPath, packageJSON } = pylanceExtension;
49-
const distUrl = `${extensionPath}/dist`;
48+
const { extensionUri, packageJSON } = pylanceExtension;
49+
const distUrl = vscode.Uri.joinPath(extensionUri, 'dist');
5050

5151
try {
52-
const worker = new Worker(`${distUrl}/browser.server.bundle.js`);
52+
const worker = new Worker(vscode.Uri.joinPath(distUrl, 'browser.server.bundle.js').toString());
5353

5454
// Pass the configuration as the first message to the worker so it can
5555
// have info like the URL of the dist folder early enough.
5656
//
5757
// This is the same method used by the TS worker:
5858
// https://github.com/microsoft/vscode/blob/90aa979bb75a795fd8c33d38aee263ea655270d0/extensions/typescript-language-features/src/tsServer/serverProcess.browser.ts#L55
59-
const config: BrowserConfig = {
60-
distUrl,
61-
};
59+
const config: BrowserConfig = { distUrl: distUrl.toString() };
6260
worker.postMessage(config);
6361

6462
const middleware = new LanguageClientMiddlewareBase(

0 commit comments

Comments
 (0)