diff --git a/src/editor/codemirror/language-server/signatureHelp.ts b/src/editor/codemirror/language-server/signatureHelp.ts index de7fed6b6..9e8013de3 100644 --- a/src/editor/codemirror/language-server/signatureHelp.ts +++ b/src/editor/codemirror/language-server/signatureHelp.ts @@ -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");