Skip to content

Commit

Permalink
Use extensionUrl instead of extensionPath (#19122)
Browse files Browse the repository at this point in the history
  • Loading branch information
karthiknadig authored May 11, 2022
1 parent 2164f56 commit fee6a2f
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/client/browser/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,20 +45,18 @@ async function runPylance(
context: vscode.ExtensionContext,
pylanceExtension: vscode.Extension<unknown>,
): Promise<void> {
const { extensionPath, packageJSON } = pylanceExtension;
const distUrl = `${extensionPath}/dist`;
const { extensionUri, packageJSON } = pylanceExtension;
const distUrl = vscode.Uri.joinPath(extensionUri, 'dist');

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

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

const middleware = new LanguageClientMiddlewareBase(
Expand Down

0 comments on commit fee6a2f

Please sign in to comment.