提交 fae8e8e9 编写于 作者: M Matt Bierner

Prevent multiple calls to listen

上级 28b5996f
......@@ -167,6 +167,7 @@ export default class BufferSyncSupport {
private readonly pendingDiagnostics = new Map<string, number>();
private readonly diagnosticDelayer: Delayer<any>;
private pendingGetErr: { request: Promise<any>, files: string[], token: CancellationTokenSource } | undefined;
private listening: boolean = false;
constructor(
client: ITypeScriptServiceClient,
......@@ -187,6 +188,10 @@ export default class BufferSyncSupport {
public readonly onDelete = this._onDelete.event;
public listen(): void {
if (this.listening) {
return;
}
this.listening = true;
workspace.onDidOpenTextDocument(this.openTextDocument, this, this.disposables);
workspace.onDidCloseTextDocument(this.onDidCloseTextDocument, this, this.disposables);
workspace.onDidChangeTextDocument(this.onDidChangeTextDocument, this, this.disposables);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册