Skip to content

Commit 0ffea10

Browse files
committed
Fix bug in prior PR
1 parent cfa068c commit 0ffea10

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

Extension/src/LanguageServer/protocolFilter.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,8 @@ export function createProtocolFilter(): Middleware {
4141
// client.takeOwnership() will call client.TrackedDocuments.add() again, but that's ok. It's a Set.
4242
client.takeOwnership(document);
4343
void sendMessage(document);
44-
const editor: vscode.TextEditor | undefined = vscode.window.visibleTextEditors.find(editor => editor.document === document);
45-
if (editor) {
46-
client.onDidChangeVisibleTextEditors([editor]).catch(logAndReturn.undefined);
47-
}
44+
const cppEditors: vscode.TextEditor[] = vscode.window.visibleTextEditors.filter(e => util.isCpp(e.document));
45+
client.onDidChangeVisibleTextEditors(cppEditors).catch(logAndReturn.undefined);
4846
}
4947
}
5048
},

0 commit comments

Comments
 (0)