Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JS/TS package acquisition #184438

Merged
merged 19 commits into from
Aug 28, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fixing merge errors
mjbvz committed Jul 17, 2023

Verified

This commit was signed with the committer’s verified signature.
mjbvz Matt Bierner
commit 328f0189744af79b2243b26f90687fcd377eff79
17 changes: 12 additions & 5 deletions extensions/typescript-language-features/web/webServer.ts
Original file line number Diff line number Diff line change
@@ -127,11 +127,10 @@ function createServerHost(extensionUri: URI, logger: ts.server.Logger, apiClient

watchFiles.set(path, { path, callback, pollingInterval, options });
const watchIds = [++watchId];
const res = toResource(path);
fsWatcher.postMessage({ type: 'watchFile', uri: res, id: watchIds[0] });
fsWatcher.postMessage({ type: 'watchFile', uri: uri, id: watchIds[0] });
if (enabledExperimentalTypeAcquisition && looksLikeNodeModules(path)) {
watchIds.push(++watchId);
fsWatcher.postMessage({ type: 'watchFile', uri: mapUri(res, 'vscode-node-modules'), id: watchIds[1] });
fsWatcher.postMessage({ type: 'watchFile', uri: mapUri(uri, 'vscode-node-modules'), id: watchIds[1] });
}
return {
close() {
@@ -147,9 +146,17 @@ function createServerHost(extensionUri: URI, logger: ts.server.Logger, apiClient
watchDirectory(path: string, callback: ts.DirectoryWatcherCallback, recursive?: boolean, options?: ts.WatchOptions): ts.FileWatcher {
logVerbose('fs.watchDirectory', { path });

let uri: URI;
try {
uri = toResource(path);
} catch (e) {
console.error(e);
return noopWatcher;
}

watchDirectories.set(path, { path, callback, recursive, options });
watchId++;
fsWatcher.postMessage({ type: 'watchDirectory', recursive, uri: toResource(path), id: watchId });
const watchIds = [++watchId];
fsWatcher.postMessage({ type: 'watchDirectory', recursive, uri, id: watchId });
return {
close() {
logVerbose('fs.watchDirectory.close', { path });