fix(autocomplete): no ghost text in the Copilot Chat prompt box - #154
Conversation
The provider registers on '**', and VS Code exposes the chat prompt as a virtual editor document with the chatSessionInput / sessions-chat schemes (chatInputSchemes in VS Code's chat/common/constants.ts), so suggestions were also offered while typing prompts. The provider now early-returns for chat-input documents via the pure isChatInputDocument() helper; unit-tested (278 tests).
Instead of unconditionally blocking the Copilot Chat prompt box, a new setting opencodego.inlineSuggestionsChatInput (default false) lets users opt in to completions while typing prompts; the provider skips chat-input documents unless it is enabled. The pure isChatInputDocument() helper remains as the gate (278 tests).
|
@Fahad090NP clean fix, small scope, CI pass, 278 tests green.
One note: Merge when ready. |
Addresses the ltmoerdani#154 review note: CHAT_INPUT_SCHEMES hardcodes two schemes, so future VS Code interactive surfaces would need a manual update. The provider now serves only real editable code surfaces via a CODE_EDITOR_SCHEMES allowlist (file, untitled, git, vscode-userdata, vscode-notebook-cell) — any new chat/interactive/webview surface is excluded automatically — with the opt-in chat-prompt carve-out preserved. isCompletionDocument() is pure and unit-tested (280 tests).
|
Thanks for the review @ltmoerdani — addressed your note about the hardcoded schemes. The provider now serves only real editable code surfaces via a code-editor scheme allowlist ( New pure helper |
|
Nice update. The allowlist approach is better than the original blocklist. Future VS Code interactive surfaces are excluded automatically, and genuinely new code surfaces are rare enough that manual updates are fine. Tests cover the right cases. CI still green. Approved. |
Fixes #153 — implemented as an opt-in feature.
What
With
opencodego.inlineSuggestionsenabled, ghost-text suggestions also appeared in the GitHub Copilot Chat prompt box while writing prompts — VS Code exposes the prompt as a virtualchatSessionInput/sessions-chatdocument (chatInputSchemesinworkbench/contrib/chat/common/constants.ts) and our"**"selector matched it.Instead of a hard block, this ships as a user choice:
opencodego.inlineSuggestionsChatInput(defaultfalse) — when on, completions are also offered while typing prompts; off keeps ghost text in code editors only.isChatInputDocument()helper (verified schemes), checking the setting before building context or starting any request.Verification
Unit tests for
isChatInputDocument(chat schemes rejected,file/untitledaccepted); 278 tests, strict ESLint + tsc + prettier + markdownlint green. Not installed — awaiting review/merge.