Skip to content

Commit

Permalink
Fixing some project wide intellisense issues in safari (#176294)
Browse files Browse the repository at this point in the history
For #175229

- Safari can't transfer `Proxy` objects
- Safari's nested worker polyfill wasn't forwarding along the `ports` field on message events
  • Loading branch information
mjbvz authored Mar 6, 2023
1 parent 3647f71 commit 797291f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,9 @@ export abstract class BaseServiceConfigurationProvider implements ServiceConfigu
}

protected readWatchOptions(configuration: vscode.WorkspaceConfiguration): Proto.WatchOptions | undefined {
return configuration.get<Proto.WatchOptions>('typescript.tsserver.watchOptions');
const watchOptions = configuration.get<Proto.WatchOptions>('typescript.tsserver.watchOptions');
// Returned value may be a proxy. Clone it into a normal object
return { ...(watchOptions ?? {}) };
}

protected readIncludePackageJsonAutoImports(configuration: vscode.WorkspaceConfiguration): 'auto' | 'on' | 'off' | undefined {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const _bootstrapFnSource = (function _bootstrapFn(workerUrl: string) {
});

port.addEventListener('message', msg => {
globalThis.dispatchEvent(new MessageEvent('message', { data: msg.data }));
globalThis.dispatchEvent(new MessageEvent('message', { data: msg.data, ports: msg.ports ? [...msg.ports] : undefined }));
});

port.start();
Expand Down

0 comments on commit 797291f

Please sign in to comment.