Skip to content

Commit

Permalink
Make sure we always reset bufferSyncSupport when the TS server is sta…
Browse files Browse the repository at this point in the history
…rted

Splits `reset` from `reinitialize` and makes sure we always `resset` buffer sync support when the service starts
  • Loading branch information
mjbvz committed Nov 14, 2019
1 parent 537fcc4 commit 88c2100
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,10 @@ export default class BufferSyncSupport extends Disposable {
this.pendingGetErr?.cancel();
this.pendingDiagnostics.clear();
this.synchronizer.reset();
}

public reinitialize(): void {
this.reset();
for (const buffer of this.syncedBuffers.allBuffers) {
buffer.open();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,6 @@ export default class TypeScriptServiceClientHost extends Disposable {

private populateService(): void {
this.fileConfigurationManager.reset();
this.client.bufferSyncSupport.reset();
this.client.bufferSyncSupport.requestAllDiagnostics();

// See https://github.com/Microsoft/TypeScript/issues/5530
vscode.workspace.saveAll(false).then(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,8 @@ export default class TypeScriptServiceClient extends Disposable implements IType
}

private serviceStarted(resendModels: boolean): void {
this.bufferSyncSupport.reset();

const configureOptions: Proto.ConfigureRequestArguments = {
hostInfo: 'vscode',
preferences: {
Expand All @@ -476,6 +478,8 @@ export default class TypeScriptServiceClient extends Disposable implements IType
this.setCompilerOptionsForInferredProjects(this._configuration);
if (resendModels) {
this._onResendModelsRequested.fire();
this.bufferSyncSupport.reinitialize();
this.bufferSyncSupport.requestAllDiagnostics();
}

// Reconfigure any plugins
Expand Down

0 comments on commit 88c2100

Please sign in to comment.