Skip to content

Commit

Permalink
fix: file watcher not working
Browse files Browse the repository at this point in the history
close #2028
  • Loading branch information
johnsoncodehk committed Oct 22, 2022
1 parent 415a4f7 commit fc5db46
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 12 deletions.
1 change: 1 addition & 0 deletions packages/language-server/src/utils/project.ts
Expand Up @@ -131,6 +131,7 @@ export async function createProject(

if (creates.length || deletes.length) {
parsedCommandLine = createParsedCommandLine(ts, sys, shared.getPathOfUri(rootUri.toString()), tsConfig, plugins);
projectVersion++;
typeRootVersion++;
}
}
Expand Down
29 changes: 17 additions & 12 deletions packages/language-server/src/utils/workspaces.ts
Expand Up @@ -41,6 +41,9 @@ export function createWorkspaces(
if (tsConfigChanges.length) {
reloadDiagnostics();
}
else {
onDriveFileUpdated();
}
});
runtimeEnv.onDidChangeConfiguration?.(async () => {
onDriveFileUpdated();
Expand All @@ -51,18 +54,20 @@ export function createWorkspaces(
getProject,
reloadProject,
add: (rootUri: URI) => {
workspaces.set(rootUri.toString(), createWorkspaceProjects(
runtimeEnv,
plugins,
fsHost,
rootUri,
ts,
tsLocalized,
documents,
configurationHost,
cancelTokenHost,
options,
));
if (!workspaces.has(rootUri.toString())) {
workspaces.set(rootUri.toString(), createWorkspaceProjects(
runtimeEnv,
plugins,
fsHost,
rootUri,
ts,
tsLocalized,
documents,
configurationHost,
cancelTokenHost,
options,
));
}
},
remove: (rootUri: URI) => {
const _workspace = workspaces.get(rootUri.toString());
Expand Down

0 comments on commit fc5db46

Please sign in to comment.