Suppress "No suggestions" popup in completion dropdown
Problem
When typing in the editor and no completions are available, Monaco shows a "No suggestions." popup message. This is unnecessary visual noise that doesn't provide value to the user.
Screenshot:
The popup appears in contexts like WITH fa¦ where no completions match the typed text.
Current Behavior
Monaco's provideCompletionItems returns { suggestions: [] } in several scenarios:
- Enter pressed on empty line
- Token/request cancelled
- Ghost syntax closure with no completions
- Space trigger with no schema completions
- Stale request (race protection)
- Error cases
When an empty suggestions array is returned, Monaco displays "No suggestions." popup.
Proposed Enhancement
Return undefined instead of { suggestions: [] } for intentionally empty cases.
Monaco treats these differently:
{ suggestions: [] }→ Shows "No suggestions" popupundefined→ Silently closes/hides dropdown (no popup)
Implementation
File: frontend/src/models/managers/MonacoStaticManager.ts
- Change early returns from:
return { suggestions: [] };
to:
return undefined;
- For main return path, add check:
if (suggestions.length === 0 && !result.isIncomplete) {
return undefined; // No popup when truly no suggestions
}
return { suggestions, incomplete: shouldBeIncomplete };
Affected Lines
- Line 3301: Enter on empty line
- Line 3309: Token cancelled
- Line 3420: Ghost syntax closure
- Line 3446: Space trigger (no schema)
- Line 3461: Stale request
- Line 3466: Token cancelled after Prism
- Line 4588: Error case
- Line 4570: Main return (conditional)
Impact Analysis
| Scenario | Current | After Change |
|----------|---------|--------------|
| No matching completions | Shows "No suggestions" | Dropdown closes silently |
| Cancelled requests | Shows "No suggestions" | Dropdown closes silently |
| Schema still loading | Shows "Loading..." | No change (keeps incomplete: true) |
| Valid completions | Shows completions | No change |
Alternative Considered
CSS hack to hide the message:
.suggest-widget .message { display: none; }
Rejected: Would also hide legitimate messages like "Loading table schemas..."
Expected Behavior
When no completions are available, the dropdown should simply not appear (or close silently) rather than showing an explicit "No suggestions" message.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗