From 4675e19fff57c5ac862c8ae50fb7c0bf7dc5f1fd Mon Sep 17 00:00:00 2001 From: Alex Kanunnikov Date: Thu, 15 Apr 2021 02:16:56 +0300 Subject: [PATCH] fix: update debounce implementation (#250) fixes https://github.com/lifeart/ember-language-server/issues/249 --- src/server.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server.ts b/src/server.ts index 86729114..d1445373 100644 --- a/src/server.ts +++ b/src/server.ts @@ -272,7 +272,7 @@ export default class Server { this.documents.listen(this.connection); this.onDidChangeContent = this.onDidChangeContent.bind(this); - this._onDidChangeContent = this._onDidChangeContent.bind(this); + this._onDidChangeContent = debounce(this._onDidChangeContent.bind(this), 250); // Bind event handlers this.connection.onInitialize(this.onInitialize.bind(this)); @@ -461,7 +461,7 @@ export default class Server { private async onDidChangeContent(change: TextDocumentChangeEvent) { this.lastChangeEvent = change; - debounce(this._onDidChangeContent, 250); + this._onDidChangeContent(); } private async _onDidChangeContent() {