Skip to content

Commit 0390a36

Browse files
committed
Move some code around
1 parent 07b6ccb commit 0390a36

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Extension/src/LanguageServer/client.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1285,6 +1285,12 @@ export class DefaultClient implements Client {
12851285

12861286
// Listen for messages from the language server.
12871287
this.registerNotifications();
1288+
1289+
// If a file is already open when we activate, sometimes we don't get any notifications about visible
1290+
// or active text editors, visible ranges, or text selection. As a workaround, we trigger
1291+
// onDidChangeVisibleTextEditors here.
1292+
const cppEditors: vscode.TextEditor[] = vscode.window.visibleTextEditors.filter(e => util.isCpp(e.document));
1293+
await this.onDidChangeVisibleTextEditors(cppEditors);
12881294
}
12891295

12901296
// update all client configurations
@@ -1604,12 +1610,6 @@ export class DefaultClient implements Client {
16041610
// A request is used in order to wait for completion and ensure that no subsequent
16051611
// higher priority message may be processed before the Initialization request.
16061612
await languageClient.sendRequest(InitializationRequest, cppInitializationParams);
1607-
1608-
// If a file is already open when we activate, sometimes we don't get any notifications about visible
1609-
// or active text editors, visible ranges, or text selection. As a workaround, we trigger
1610-
// onDidChangeVisibleTextEditors here.
1611-
const cppEditors: vscode.TextEditor[] = vscode.window.visibleTextEditors.filter(e => util.isCpp(e.document));
1612-
await this.onDidChangeVisibleTextEditors(cppEditors);
16131613
}
16141614

16151615
public async sendDidChangeSettings(): Promise<void> {

0 commit comments

Comments
 (0)