mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-22 17:48:56 +01:00
Make sure we always reset bufferSyncSupport when the TS server is started
Splits `reset` from `reinitialize` and makes sure we always `resset` buffer sync support when the service starts
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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(() => {
|
||||
|
||||
@@ -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: {
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user