Repository navigation
Description
Opportunity
When I write code in TuiCode I type every name in full. I can't see a type's members, or which names fit where the caret is, without leaving the line: I run Go to definition or Quick info, read, and come back. Typing builder. in any other editor I use shows me what comes next. So for anything longer than a quick fix, I go back to VS Code or Rider.
Evidence:
- On
main(d502ee5) TuiCode runs a language server for C#, Go, Rust, TypeScript/JavaScript and Python, and asks it for definitions, references, hover, symbols and problems, but never for completions. Every one of those servers answerstextDocument/completion. - VS Code and JetBrains, which the vision learns from, offer completion as you type out of the box.
- Fresh, a terminal-first editor, ships language-server completion and falls back to words in the buffer when there's no server (fresh docs, v0.2.21).
- micro users have asked for completion since 2016 (micro#174, micro#1138); it still only comes from a plugin (mlsp).
Options considered
- Do nothing; lean on AI assistance. Ask the agent in the AI panel to write the code. Good: no work. Bad: it's a different job. Completion helps while I write, a keystroke at a time. Sending every line to an agent is slow, and doesn't help when I just want the right member name.
- Words from open files only, no server. Offer the identifiers already in the buffer. Good: small, works for every language and with no server. Bad: it doesn't know types, so
builder.offers every word in the file. That's the guessing this is meant to stop. - Server completion, on demand only. A command opens the list at the caret; nothing pops up by itself. Good: never gets in the way while typing. Bad: you have to remember to ask. VS Code users expect it to appear after
., and an on-demand list that nobody opens doesn't close the gap. - Server completion as you type, plus the command (chosen). The list opens by itself after a character the server names (
.in C#) and after the first letters of a name, and the same command opens it anywhere. Good: it's what a VS Code user expects within a minute of typing, and it's built on the servers already running. Bad: the most work of the four, and the list is one more thing that can get in the way, so it needs an off switch. - Inline suggestions from an AI (ghost text). Good: writes whole lines. Bad: needs a model behind every keystroke. AI assistance talks to the user's own agent over ACP, not a built-in model (register, LLM-assisted coding #62), so this doesn't fit. A different idea from this one anyway.
I chose 4: it's the experience the opportunity describes, and all the hard parts (servers, document sync, Quick info's box under the caret) exist already.
Proposal
While I type in a file whose language server is running, a list of what fits at the caret opens under it:
- It opens by itself after a character the server says starts completion (
.in C#,::in Rust), and after I type the first letter of a name. Show completions (sc, F1, the Go menu beside Quick info) opens it anywhere, including on an empty spot. - Each row has the item's kind as a short icon or letter (method, property, field, type, keyword…), its name with the letters I've typed so far highlighted, and its short detail (the signature or type) in dim text on the right.
- As I keep typing, the list narrows to what still matches, best match first, without asking the server again unless the server said its list was incomplete.
Up/Down(andPageUp/PageDown) move the selection.TaborEnterputs the selected item in, replacing what I'd typed of the name.Esccloses it. Any other key that isn't part of a name (space,(,;, arrows left and right) closes it and goes on to the editor as usual.- It never takes focus from the editor, the same as Quick info: its keys layer over the editor's while it's open.
F1while it's open lists its keys. - Only the latest request shows; a late answer for an earlier position is dropped.
- With no server for the file, or the server not ready yet, nothing opens by itself. Show completions says what Quick info says in that case.
- A checkbox in Settings, Suggest as I type, on by default, turns off the automatic opening. The command still works.
Mockup
Typing in a C# file, after sb.Ap:
12 │ var sb = new StringBuilder();
13 │ sb.Ap█
│ ┌──────────────────────────────────────────────────────┐
│ │ ƒ Append StringBuilder Append(string?) │
│ │ ƒ AppendFormat StringBuilder AppendFormat(st… │
│ │ ƒ AppendJoin StringBuilder AppendJoin(stri… │
│ │ ƒ AppendLine StringBuilder AppendLine() │
│ └──────────────────────────────────────────────────────┘
14 │ return sb.ToString();
The selected row is drawn in the list's focus colour (Append here). Ap is drawn in the accent colour in each name. When there's more room above the caret's line than below, the box opens above it, as Quick info's does. It's a ListView with no title, buttons or scroll bar label: just rows, at most 10 tall, and as wide as its longest row up to the window's width.
Scope
In:
- Asking the running language server for completions, as you type and on demand, in every language TuiCode starts a server for.
- The list, narrowing, accepting with
Tab/Enter, closing withEsc. - Putting in the item's text the way the server says (its replacement range where it gives one), as plain text.
- Show completions (
sc) and the Suggest as I type setting.
Out:
- Signature help (the parameter hint while typing a call's arguments). A follow-up once this has been used.
- Snippets with placeholders (
for→ a whole loop). TuiCode will tell the server it doesn't take snippets, so the server sends plain text. - Adding a missing
using/import when accepting an item. That's When TuiCode marks an error it already knows how to fix, like a missing using, I still have to make the fix by hand #700. - A documentation pane beside the list. The detail column, then Quick info on the inserted name, covers it.
- Words from the buffer when there's no server (option 2).
- More than one caret: with several carets, the list doesn't open.
Delivery
One PR. It's one experience the user tries in one sitting, and it's well under the size of a sitting's review.
Assumed
- No default key for Show completions. New commands ship with no default key; the mnemonic, menu and palette reach them (register: you, on Compare to command #61). VS Code's key for this is
Ctrl+Space, which is TuiCode's leader, so it isn't free anyway. Anyone who wants a key binds one in Settings. TabandEnterboth accept, as in VS Code. TypingEnterto end a line while the list is open needsEscfirst. That's VS Code's default too, and the off switch is there for anyone who hates it.- It opens by itself by default. Option 4 only beats option 3 if it does; the setting turns it off.
- The box never takes focus, keys layered over the editor's, the same pattern as Quick info (Quick info (Ctrl+G I, gi) shows what the name under the cursor is, in a box under the line #591). The style guide has no rule for a list under the caret, so this follows TuiCode's own nearest one. If it turns out to be a pattern other MentalDesk apps need, it goes to the style guide afterwards.
- Only the latest request shows, as for Quick info and Go to definition.
- Mnemonic
scfor Show completions, the label's initials (register: you, on On an interface or abstract method I can't get to the code that actually runs; Go to definition stops at the declaration #682). It's free and isn't a prefix of another.
Original idea
While I type, I can't see what names fit here, so I type each in full or check its definition first
When I'm writing code in TuiCode, I type every name out in full. I can't see which members a type has, or which overloads a method takes, without leaving the line: I open Go to definition or Quick info, read it, and come back. In any other editor I use, typing
builder.would show me what comes next. So for anything longer than a quick fix, I go back to VS Code or Rider.(Filed by the Lead; evidence and fit as above.)
Activity
a-team-app commentedon Nov 17, 2026
Recommended: High · theme 3, medium · the biggest Code intelligence gap left; servers already run, only the request and popup are missing
a-team-app commentedon Nov 19, 2026
Up for your decision: completion as you type, from the language servers already running, with Show completions (
sc) to open it anywhere and a Suggest as I type switch in Settings.Two wording fixes since the draft: Quick info is no longer named by its mnemonic, since #701 moves it from
gitoqi; and snippets are now described as something this pitch will turn off, since TuiCode doesn't declare completion to servers at all yet. Nothing needs your answer: approve, or comment to change an assumption.