Skip to content

Commit

Permalink
fix: update debounce implementation (#250)
Browse files Browse the repository at this point in the history
fixes #249
  • Loading branch information
lifeart authored Apr 14, 2021
1 parent e2f3c83 commit 4675e19
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down Expand Up @@ -461,7 +461,7 @@ export default class Server {

private async onDidChangeContent(change: TextDocumentChangeEvent<TextDocument>) {
this.lastChangeEvent = change;
debounce(this._onDidChangeContent, 250);
this._onDidChangeContent();
}

private async _onDidChangeContent() {
Expand Down

0 comments on commit 4675e19

Please # to comment.