turbo-editors/turbo-gopublic Fork 0
v1.0.0
Commits
Clone
git clone https://git.rickub.com/turbo-editors/turbo-go.git
git clone ssh://git@rickub.com/turbo-editors/turbo-go.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

📦 Turbo Go 3d7798b · on v1.0.0 · k33g · 9h ago
2026-08-30-completion-diagnosis.md · 33 lines · 3.6 KBmarkdown
Blame HistoryOpen raw

Handoff — 2026-08-30 — the completion fix was still droppable

State

Two more rounds of user feedback, both now closed.

The menu. Reported as changed and broken; could not be reproduced. The real binary was driven under a pty and F10, Alt-F, Alt-E, a mouse click and Down+Enter all worked, with and without a language server. internal/ui/menu.go had not been touched. The user confirmed it works again — almost certainly a stale binary.

Completion. Two separate things were wrong, and only one of them was the editor's fault.

  1. The editor's fault, now fixed. The previous session's re-announcement rode on screen.PostEvent, which drops events when tcell's queue is full — and start-up is exactly when gopls floods that queue with diagnostics for the whole module. The announcement could therefore never arrive, silently, and completion would be empty again. It is now checked on every turn of the event loop instead, and depends on no message at all.

  2. Not the editor's fault, now explained. The user had a hello.go in the repository root declaring package main and func main() beside the project's own main.go. The package does not compile, and gopls answers nothing at all — no error, an empty list — for a package it cannot load. Reproduced with a probe against real gopls in an identical two-main module: 0 completions. The editor used to say "No completions here", which is true and useless. It now says which problem is in the way, and Run ▸ Language server status reports the server path, the root, the file, and whether the server has even been told about it.

Two things to carry forward

Never make correctness depend on PostEvent. It is best-effort by design. A redraw is a fine thing to lose; a state transition is not. Anything that must happen belongs in the loop's own turn, guarded by a flag.

hello.go in the repository root is the user's file, not an artefact. The working tree is mounted from their machine. An empty one appeared earlier and was deleted as rubbish — it was theirs. It was empty and nothing was lost, but do not assume a file that appears in the tree is yours. It currently breaks go build ./... and go vet ./... for the root package; ./internal/... is unaffected. Ask before removing it.

Next steps

  1. Ask whether hello.go should go. Until it does, the root package does not compile, which also means gopls will keep refusing to complete anywhere in this repository.
  2. Consider a second completion binding. Ctrl-Space is claimed by tmux, screen and most IDE terminals before the editor sees it. Typing . and Run ▸ Completion both work and are documented, but a function key would be more reliable. Nothing has been chosen; it needs the user's opinion.
  3. Unchanged from the previous handoffs: show diagnostics in the gutter rather than only on the status bar; add CI; try macOS and Windows.
  4. Resize is done and verified (see the fifth history entry): windows carry a Turbo Vision grow mode and follow the terminal, checked live on a real pty with SIGWINCH. What remains unverified on hardware is mouse dragging and corner-resizing.

Watch out for

Everything in the two previous handoffs still applies. And:

  • A completion test whose fixture already contains the text being completed proves nothing — gopls answers it from disk. The text must be typed into the buffer. Verified by removing the fix and watching the test fail.
  • go build ./... currently fails because of the user's hello.go. Use ./internal/... while it is there, and do not mistake that failure for one of your own.
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# Handoff — 2026-08-30 — the completion fix was still droppable

## State

Two more rounds of user feedback, both now closed.

**The menu.** Reported as changed and broken; **could not be reproduced**. The real binary was driven under a pty and F10, Alt-F, Alt-E, a mouse click and Down+Enter all worked, with and without a language server. `internal/ui/menu.go` had not been touched. The user confirmed it works again — almost certainly a stale binary.

**Completion.** Two separate things were wrong, and only one of them was the editor's fault.

1. **The editor's fault, now fixed.** The previous session's re-announcement rode on `screen.PostEvent`, which **drops events when tcell's queue is full** — and start-up is exactly when gopls floods that queue with diagnostics for the whole module. The announcement could therefore never arrive, silently, and completion would be empty again. It is now checked on every turn of the event loop instead, and depends on no message at all.

2. **Not the editor's fault, now explained.** The user had a `hello.go` in the repository root declaring `package main` and `func main()` beside the project's own `main.go`. The package does not compile, and gopls answers **nothing at all — no error, an empty list** — for a package it cannot load. Reproduced with a probe against real gopls in an identical two-`main` module: 0 completions. The editor used to say "No completions here", which is true and useless. It now says which problem is in the way, and `Run ▸ Language server status` reports the server path, the root, the file, and whether the server has even been told about it.

## Two things to carry forward

**Never make correctness depend on `PostEvent`.** It is best-effort by design. A redraw is a fine thing to lose; a state transition is not. Anything that must happen belongs in the loop's own turn, guarded by a flag.

**`hello.go` in the repository root is the user's file**, not an artefact. The working tree is mounted from their machine. An empty one appeared earlier and was deleted as rubbish — it was theirs. It was empty and nothing was lost, but do not assume a file that appears in the tree is yours. It currently breaks `go build ./...` and `go vet ./...` for the root package; `./internal/...` is unaffected. Ask before removing it.

## Next steps

1. **Ask whether `hello.go` should go.** Until it does, the root package does not compile, which also means gopls will keep refusing to complete anywhere in this repository.
2. **Consider a second completion binding.** `Ctrl-Space` is claimed by tmux, screen and most IDE terminals before the editor sees it. Typing `.` and `Run ▸ Completion` both work and are documented, but a function key would be more reliable. Nothing has been chosen; it needs the user's opinion.
3. Unchanged from the previous handoffs: show diagnostics in the gutter rather than only on the status bar; add CI; try macOS and Windows.
4. **Resize is done and verified** (see the fifth history entry): windows carry a Turbo Vision grow mode and follow the terminal, checked live on a real pty with SIGWINCH. What remains unverified on hardware is mouse dragging and corner-resizing.

## Watch out for

Everything in the two previous handoffs still applies. And:

- **A completion test whose fixture already contains the text being completed proves nothing** — gopls answers it from disk. The text must be typed into the buffer. Verified by removing the fix and watching the test fail.
- **`go build ./...` currently fails** because of the user's `hello.go`. Use `./internal/...` while it is there, and do not mistake that failure for one of your own.