Skip to content

Commit

Permalink
Wrap entire try block in queueMicrotask
Browse files Browse the repository at this point in the history
  • Loading branch information
microbit-robert committed Nov 28, 2024
1 parent c5b9427 commit 9127e5c
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/editor/codemirror/language-server/signatureHelp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,18 +91,18 @@ const triggerSignatureHelpRequest = async (
try {
// Must happen before other event handling that might dispatch more
// changes that invalidate our position.
queueMicrotask(() => {
queueMicrotask(async () => {
const result = await client.connection.sendRequest(
SignatureHelpRequest.type,
params
);
view.dispatch({
effects: [setSignatureHelpRequestPosition.of(pos)],
effects: [
setSignatureHelpRequestPosition.of(pos),
setSignatureHelpResult.of(result),
],
});
});
const result = await client.connection.sendRequest(
SignatureHelpRequest.type,
params
);
view.dispatch({
effects: [setSignatureHelpResult.of(result)],
});
} catch (e) {
if (!isErrorDueToDispose(e)) {
logException(state, e, "signature-help");
Expand Down

0 comments on commit 9127e5c

Please sign in to comment.