Skip to content

Commit 31139ab

Browse files
committed
Switch to await this.ready;
1 parent 0fe7e05 commit 31139ab

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Extension/src/LanguageServer/client.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1839,11 +1839,11 @@ export class DefaultClient implements Client {
18391839
await this.languageClient.sendNotification(DidChangeTextEditorVisibleRangesNotification, params);
18401840
}
18411841

1842-
public onDidChangeTextDocument(textDocumentChangeEvent: vscode.TextDocumentChangeEvent): void {
1842+
public async onDidChangeTextDocument(textDocumentChangeEvent: vscode.TextDocumentChangeEvent): Promise<void> {
1843+
await this.ready;
18431844
if (util.isCpp(textDocumentChangeEvent.document)) {
18441845
// If any file has changed, we need to abort the current rename operation
1845-
if (workspaceReferences !== undefined // Occurs when a document changes before cpptools starts.
1846-
&& workspaceReferences.renamePending) {
1846+
if (workspaceReferences.renamePending) {
18471847
workspaceReferences.cancelCurrentReferenceRequest(refs.CancellationSender.User);
18481848
}
18491849

0 commit comments

Comments
 (0)