Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Extension/src/LanguageServer/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ import * as configs from './configurations';
import { CopilotCompletionContextFeatures, CopilotCompletionContextProvider } from './copilotCompletionContextProvider';
import { DataBinding } from './dataBinding';
import { cachedEditorConfigSettings, getEditorConfigSettings } from './editorConfig';
import { CppSourceStr, clients, configPrefix, updateLanguageConfigurations, usesCrashHandler, watchForCrashes } from './extension';
import { CppSourceStr, clients, configPrefix, initializeIntervalTimer, updateLanguageConfigurations, usesCrashHandler, watchForCrashes } from './extension';
import { LocalizeStringParams, getLocaleId, getLocalizedString } from './localization';
import { PersistentFolderState, PersistentState, PersistentWorkspaceState } from './persistentState';
import { RequestCancelled, ServerCancelled, createProtocolFilter } from './protocolFilter';
Expand Down Expand Up @@ -1365,6 +1365,8 @@ export class DefaultClient implements Client {
// Listen for messages from the language server.
this.registerNotifications();

initializeIntervalTimer();

// If a file is already open when we activate, sometimes we don't get any notifications about visible
// or active text editors, visible ranges, or text selection. As a workaround, we trigger
// onDidChangeVisibleTextEditors here.
Expand Down
6 changes: 4 additions & 2 deletions Extension/src/LanguageServer/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,6 @@ export async function activate(): Promise<void> {

vcpkgDbPromise = initVcpkgDatabase();

void clients.ActiveClient.ready.then(() => intervalTimer = global.setInterval(onInterval, 2500));

await registerCommands(true);

vscode.tasks.onDidStartTask(() => getActiveClient().PauseCodeAnalysis());
Expand Down Expand Up @@ -366,6 +364,10 @@ function onInterval(): void {
clients.ActiveClient.onInterval();
}

export function initializeIntervalTimer(): void {
intervalTimer = global.setInterval(onInterval, 2500);
}

/**
* registered commands
*/
Expand Down