Skip to content

Commit da9932d

Browse files
authored
Use extensionUrl instead of extensionPath (#19120)
1 parent e7a7a92 commit da9932d

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/client/browser/extension.ts

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

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

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

6664
const middleware = new LanguageClientMiddlewareBase(

0 commit comments

Comments
 (0)