Skip to content

Commit 62906f1

Browse files
committed
Merge branch 'main' of https://github.com/microsoft/vscode-cpptools into coleng/fix_didOpen_didChange_race
2 parents 9f8cdda + 77f30fa commit 62906f1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Extension/src/LanguageServer/client.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1842,7 +1842,8 @@ export class DefaultClient implements Client {
18421842
public onDidChangeTextDocument(textDocumentChangeEvent: vscode.TextDocumentChangeEvent): void {
18431843
if (util.isCpp(textDocumentChangeEvent.document)) {
18441844
// If any file has changed, we need to abort the current rename operation
1845-
if (workspaceReferences.renamePending) {
1845+
if (workspaceReferences !== undefined // Occurs when a document changes before cpptools starts.
1846+
&& workspaceReferences.renamePending) {
18461847
workspaceReferences.cancelCurrentReferenceRequest(refs.CancellationSender.User);
18471848
}
18481849

0 commit comments

Comments
 (0)