Skip to content

fix(autocomplete): no ghost text in the Copilot Chat prompt box - #154

Merged
ltmoerdani merged 3 commits into
ltmoerdani:mainfrom
Fahad090NP:fix/chat-input-suggestions
Aug 14, 2026
Merged

fix(autocomplete): no ghost text in the Copilot Chat prompt box#154
ltmoerdani merged 3 commits into
ltmoerdani:mainfrom
Fahad090NP:fix/chat-input-suggestions

Conversation

@Fahad090NP

@Fahad090NP Fahad090NP commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Fixes #153 — implemented as an opt-in feature.

What

With opencodego.inlineSuggestions enabled, ghost-text suggestions also appeared in the GitHub Copilot Chat prompt box while writing prompts — VS Code exposes the prompt as a virtual chatSessionInput / sessions-chat document (chatInputSchemes in workbench/contrib/chat/common/constants.ts) and our "**" selector matched it.

Instead of a hard block, this ships as a user choice:

  • New setting opencodego.inlineSuggestionsChatInput (default false) — when on, completions are also offered while typing prompts; off keeps ghost text in code editors only.
  • The provider gates chat-input documents through the pure isChatInputDocument() helper (verified schemes), checking the setting before building context or starting any request.

Verification

Unit tests for isChatInputDocument (chat schemes rejected, file/untitled accepted); 278 tests, strict ESLint + tsc + prettier + markdownlint green. Not installed — awaiting review/merge.

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).
@ltmoerdani

Copy link
Copy Markdown
Owner

@Fahad090NP clean fix, small scope, CI pass, 278 tests green.

isChatInputDocument() pure helper, testable without VS Code API. Opt-in via setting makes sense — default off, backward-compatible.

One note: CHAT_INPUT_SCHEMES hardcodes 2 values (chatSessionInput, sessions-chat). If VS Code adds new schemes in a future version, this needs a manual update. Already documented in the comment, so not a blocker, but worth flagging.

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).
@Fahad090NP

Copy link
Copy Markdown
Contributor Author

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 (CODE_EDITOR_SCHEMES: file, untitled, git, vscode-userdata, vscode-notebook-cell). Any interactive surface VS Code introduces in the future — new chat-prompt variants, webviews, output, custom editors — is excluded automatically, so no manual updates needed. The opt-in carve-out for the chat prompt (opencodego.inlineSuggestionsChatInput) is preserved: chat-input documents are still allowed when the setting is on.

New pure helper isCompletionDocument() (alongside isChatInputDocument()), both unit-tested — 280 tests, strict lint + tsc green. Ready when you are.

@ltmoerdani

Copy link
Copy Markdown
Owner

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.

@ltmoerdani
ltmoerdani merged commit 9163925 into ltmoerdani:main Aug 14, 2026
2 checks passed
@Fahad090NP
Fahad090NP deleted the fix/chat-input-suggestions branch August 14, 2026 09:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inline suggestions appear in the Copilot Chat prompt box while typing

2 participants