Skip to content

Commit 5534edf

Browse files
committed
Merge branch 'main' into seanmcm/mergeToVS
2 parents 2487d52 + a204903 commit 5534edf

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Extension/src/LanguageServer/protocolFilter.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,10 @@ export function createProtocolFilter(): Middleware {
4545
// client.takeOwnership() will call client.TrackedDocuments.add() again, but that's ok. It's a Set.
4646
client.takeOwnership(document);
4747
void sendMessage(document);
48-
const cppEditors: vscode.TextEditor[] = vscode.window.visibleTextEditors.filter(e => util.isCpp(e.document));
49-
client.onDidChangeVisibleTextEditors(cppEditors).catch(logAndReturn.undefined);
48+
client.ready.then(() => {
49+
const cppEditors: vscode.TextEditor[] = vscode.window.visibleTextEditors.filter(e => util.isCpp(e.document));
50+
client.onDidChangeVisibleTextEditors(cppEditors).catch(logAndReturn.undefined);
51+
}).catch(logAndReturn.undefined);
5052
}
5153
}
5254
},

0 commit comments

Comments
 (0)