Repository navigation
fix: dismiss Jedi signature hint on Escape and closing paren - #10162
Conversation
The non-LSP (Jedi) signature hint added in #10045 lived in its own field with no dismissal wiring, so Escape (and typing the closing paren) left it stuck on screen. - Route the hint through the existing `closeSignatureHelp` path, so Escape/blur/run-cell dismiss it like the LSP signature help. - Dismiss the hint once the cursor leaves the call, using a bounded parentheses-balance scan mirroring the LSP behavior. Co-authored-by: Cursor <cursoragent@cursor.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Pull request overview
Fixes dismissal behavior for the non‑LSP (Jedi) signature hint tooltip so it closes consistently (Escape / blur / run-cell) and auto-dismisses when the cursor leaves the call (e.g., typing the closing )), aligning it with the existing LSP signature-help UX.
Changes:
- Add a bounded backward paren-balance heuristic to dismiss the Jedi signature hint once the call is closed.
- Route Jedi hint dismissal through the existing
closeSignatureHelppathway (Escape handling and other close paths). - Add/extend unit tests covering dismissal on
)and Escape-driven dismissal behavior.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| frontend/src/core/codemirror/completion/signature-hint.ts | Adds isCursorInsideCall heuristic and a closeSignatureHint helper to dismiss the Jedi tooltip. |
| frontend/src/core/codemirror/completion/tests/signature-hint.test.ts | Adds test coverage for call-close dismissal and explicit close helper behavior. |
| frontend/src/components/editor/navigation/navigation.ts | Treats the Jedi hint as “signature help” for Escape handling and ensures closeSignatureHelp also closes the hint. |
| frontend/src/components/editor/navigation/tests/navigation.test.ts | Adds a regression test ensuring Escape dismisses the Jedi hint without exiting edit mode. |
There was a problem hiding this comment.
All reported issues were addressed across 4 files
Architecture diagram
sequenceDiagram
participant User as User (Keyboard)
participant EditorView as EditorView (CodeMirror)
participant Nav as Navigation (useCellEditorNavigationProps)
participant CloseHelp as closeSignatureHelp()
participant SigHintField as signatureHintField (StateField)
participant CursorCheck as isCursorInsideCall()
Note over User,CursorCheck: Escape Key Press (Jedi hint active)
User->>EditorView: press Escape
EditorView->>Nav: onKeyDown(event)
Nav->>Nav: Check hasSignatureHelp
alt hasSignatureHelp (NEW: includes signatureHintField)
Nav->>CloseHelp: closeSignatureHelp(view)
Note over CloseHelp: Also dismisses LSP tooltip (unchanged)
CloseHelp->>SigHintField: NEW: closeSignatureHint(view)
SigHintField->>SigHintField: dispatch setSignatureHintEffect(null)
SigHintField-->>CloseHelp: true (hint dismissed)
CloseHelp-->>Nav: return
Nav->>EditorView: dispatch (clear hint)
Note over Nav,EditorView: Stay in edit mode (no focusCell)
else hasSignatureHelp is false
Nav->>EditorView: handle escape as command mode (unchanged)
end
Note over User,CursorCheck: Typing Closing Parenthesis (cursor leaves call)
User->>EditorView: type ")"
EditorView->>SigHintField: transaction (docChanged + selection)
SigHintField->>CursorCheck: NEW: isCursorInsideCall(state, head)
Note over CursorCheck: Scans back ≤20 lines counting parens
alt balance > 0 (still inside call)
CursorCheck-->>SigHintField: true
SigHintField->>SigHintField: map pos, keep hint
else balance ≤ 0 (outside call)
CursorCheck-->>SigHintField: false
SigHintField->>SigHintField: return null (dismiss hint)
end
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
Co-authored-by: Cursor <cursoragent@cursor.com>
Scan from the hint's anchor (just inside the call's paren) to the cursor instead of a global backward scan, so grouping parens around a call (e.g. `(plt.plot())`) no longer keep a stale hint alive after the call is closed. Also removes the 20-line bound. Adds regression tests. Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
All reported issues were addressed across 2 files (changes from recent commits).
Tip: Review your code locally with the cubic CLI to iterate faster.
Re-trigger cubic
There was a problem hiding this comment.
All reported issues were addressed across 2 files (changes from recent commits).
Tip: Review your code locally with the cubic CLI to iterate faster.
Re-trigger cubic
|
🚀 Development release published. You may be able to view the changes at https://marimo.app?v=0.23.15-dev30 |
…team#10162) ## 📝 Summary The non-LSP (Jedi) signature hint introduced in marimo-team#10045 lives in its own CodeMirror field (`signatureHintField`) that was never wired into any dismissal path. As a result, pressing `Escape` did not close the docstring/signature tooltip, and it also lingered after the call was closed. The LSP signature-help path already handles all of this; only the Jedi fallback path regressed. - Route the hint through the existing `closeSignatureHelp`, so **Escape / blur / run-cell** dismiss it consistently with the LSP signature help. `handleEscape` now treats an active hint like LSP signature help (dismiss + stay in edit mode), avoiding a fall-through to command mode. - Dismiss the hint once the cursor **leaves the call** (e.g. the closing `)` is typed) via a bounded parentheses-balance scan mirroring the LSP path's `isCursorInsideFunctionCall`. No new keymap is added, so there is no interaction with Vim's `Escape` handling or double-handling with `handleEscape`. The scan only runs while a hint is actually visible and the doc changes, and is capped to 20 lines back — so normal typing is unaffected. https://github.com/user-attachments/assets/53838ef7-f123-4a81-9e57-51ef03b83c5c ## 📋 Pre-Review Checklist - [x] For large changes, or changes that affect the public API: this change was discussed or approved through an issue, on [Discord](https://marimo.io/discord?ref=pr), or the community [discussions](https://github.com/marimo-team/marimo/discussions) (Please provide a link if applicable). <!-- small bug fix --> - [x] Any AI generated code has been reviewed line-by-line by the human PR author, who stands by it. - [x] Video or media evidence is provided for any visual changes (optional). ## ✅ Merge Checklist - [x] I have read the [contributor guidelines](https://github.com/marimo-team/marimo/blob/main/CONTRIBUTING.md). - [x] Documentation has been updated where applicable, including docstrings for API changes. - [x] Tests have been added for the changes made. Made with [Cursor](https://cursor.com) --------- Co-authored-by: Cursor <cursoragent@cursor.com>
📝 Summary
The non-LSP (Jedi) signature hint introduced in #10045 lives in its own CodeMirror field (
signatureHintField) that was never wired into any dismissal path. As a result, pressingEscapedid not close the docstring/signature tooltip, and it also lingered after the call was closed. The LSP signature-help path already handles all of this; only the Jedi fallback path regressed.closeSignatureHelp, so Escape / blur / run-cell dismiss it consistently with the LSP signature help.handleEscapenow treats an active hint like LSP signature help (dismiss + stay in edit mode), avoiding a fall-through to command mode.)is typed) via a bounded parentheses-balance scan mirroring the LSP path'sisCursorInsideFunctionCall. No new keymap is added, so there is no interaction with Vim'sEscapehandling or double-handling withhandleEscape.The scan only runs while a hint is actually visible and the doc changes, and is capped to 20 lines back — so normal typing is unaffected.
Screen.Recording.2026-07-14.at.12.19.17.AM.mov
📋 Pre-Review Checklist
✅ Merge Checklist
Made with Cursor