Skip to content

Commit 958969f

Browse files
committed
Address a potential race between didChange and didOpen
1 parent 62906f1 commit 958969f

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

Extension/src/LanguageServer/extension.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,13 +172,12 @@ export async function activate(): Promise<void> {
172172
getCustomConfigProviders().forEach(provider => void client.onRegisterCustomConfigurationProvider(provider));
173173
});
174174

175-
// These handlers for didChangeTextDocument and didOpenTextDocument are intentionally non-async and are
175+
// These handlers for didChangeTextDocument and didOpenTextDocument are intentionally synchronous and are
176176
// intended primarily to maintain openFileVersions with the most recent versions of files, as quickly as
177-
// possible, without being invoked before complete, delayed by awaits or queued behind other LSP messages, etc..
177+
// possible, without being delayed by awaits or queued behind other LSP messages, etc..
178178
disposables.push(vscode.workspace.onDidChangeTextDocument(onDidChangeTextDocument));
179179
disposables.push(vscode.workspace.onDidOpenTextDocument(onDidOpenTextDocument));
180180

181-
182181
disposables.push(vscode.workspace.onDidChangeConfiguration(onDidChangeSettings));
183182
disposables.push(vscode.window.onDidChangeTextEditorVisibleRanges((e) => clients.ActiveClient.enqueue(async () => onDidChangeTextEditorVisibleRanges(e))));
184183
disposables.push(vscode.window.onDidChangeActiveTextEditor((e) => clients.ActiveClient.enqueue(async () => onDidChangeActiveTextEditor(e))));

0 commit comments

Comments
 (0)