Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure updates to openFileVersion data is not delayed #12851

Merged
merged 1 commit into from
Oct 18, 2024
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
6 changes: 6 additions & 0 deletions Extension/src/LanguageServer/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ export async function activate(): Promise<void> {
});

disposables.push(vscode.workspace.onDidChangeConfiguration(onDidChangeSettings));
disposables.push(vscode.workspace.onDidChangeTextDocument(onDidChangeTextDocument));
disposables.push(vscode.window.onDidChangeTextEditorVisibleRanges((e) => clients.ActiveClient.enqueue(async () => onDidChangeTextEditorVisibleRanges(e))));
disposables.push(vscode.window.onDidChangeActiveTextEditor((e) => clients.ActiveClient.enqueue(async () => onDidChangeActiveTextEditor(e))));
ui.didChangeActiveEditor(); // Handle already active documents (for non-cpp files that we don't register didOpen).
Expand Down Expand Up @@ -288,6 +289,11 @@ async function onDidChangeSettings(event: vscode.ConfigurationChangeEvent): Prom
}
}

async function onDidChangeTextDocument(event: vscode.TextDocumentChangeEvent): Promise<void> {
const me: Client = clients.getClientFor(event.document.uri);
me.onDidChangeTextDocument(event);
}

let noActiveEditorTimeout: NodeJS.Timeout | undefined;

async function onDidChangeTextEditorVisibleRanges(event: vscode.TextEditorVisibleRangesChangeEvent): Promise<void> {
Expand Down
6 changes: 1 addition & 5 deletions Extension/src/LanguageServer/protocolFilter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,7 @@ export function createProtocolFilter(): Middleware {
}
}
}),
didChange: async (textDocumentChangeEvent, sendMessage) => clients.ActiveClient.enqueue(async () => {
const me: Client = clients.getClientFor(textDocumentChangeEvent.document.uri);
me.onDidChangeTextDocument(textDocumentChangeEvent);
await sendMessage(textDocumentChangeEvent);
}),
didChange: invoke1,
willSave: invoke1,
willSaveWaitUntil: async (event, sendMessage) => {
// await clients.ActiveClient.ready;
Expand Down
Loading