feat(cmd): ground modifier-value completion locally for stock :Forge #341

Closed
opened 2026-04-20 00:19:07 +00:00 by barrettruth · 0 comments
barrettruth commented 2026-04-20 00:19:07 +00:00

Prerequisites

  • I have searched existing issues

Problem

Modifier-value completion needs a hard boundary. Local discovery is often useful and cheap enough:

  • git refs
  • recent local SHAs
  • configured repo aliases
  • registered adapters
  • local issue templates

But forge entity-list fetching inside name=... subtrees would make the completion source harder to reason about and break the minimal stock-cmdline contract.

Proposed solution

Keep modifier-value completion grounded and local for the stock :Forge cmdline.

Global boundary

Entering any name=... subtree disables forge entity-list completion/fetching for that request. Local discovery is still allowed.

Modifier subtree contract

  • repo=
    • includes only locally derivable repo values
    • may include configured aliases, git remote names, resolved current / push / collaboration repo forms, and slug / hosted forms when derivable from those
    • may include multiple distinct valid user-facing forms even if they resolve to the same underlying repo (origin, upstream, owner/repo, github.com/owner/repo)
    • does not invent arbitrary placeholder hosted repo values
    • parser still accepts manually typed valid repo addresses
  • template=
    • may discover local issue template slugs
    • allowed on empty prefix
  • head= / base=
    • may complete local refs/tags, bounded recent short SHAs, and repo-qualified revision forms using @...
    • allowed on empty prefix
  • branch= / commit=
    • may complete local refs and bounded recent short SHAs
    • allowed on empty prefix
  • target=
    • may complete local/derived address scaffolds
    • allowed on empty prefix
  • adapter=
    • includes only actually available adapters (builtins plus registered adapters)
    • sorted alphabetically
    • does not synthesize config-only unavailable names
  • method=
    • stays purely static: merge, squash, rebase

Scope note

repo= remains the canonical scope override. No remote= modifier is introduced.

Acceptance criteria:

  • entering any name=... subtree disables forge entity-list completion/fetching for that request
  • each modifier above follows the detailed subtree contract
  • local discovery remains allowed where appropriate
  • no forge entity fetching leaks into modifier-value completion
  • repo= remains the canonical scope override; no remote= modifier is introduced

Alternatives considered

  • Replace repo= with remote=
  • Allow forge entity completion inside modifier-value subtrees
  • Synthesize config-only adapter names or arbitrary repo placeholders
## Prerequisites - [x] I have searched existing issues ## Problem Modifier-value completion needs a hard boundary. Local discovery is often useful and cheap enough: - git refs - recent local SHAs - configured repo aliases - registered adapters - local issue templates But forge entity-list fetching inside `name=...` subtrees would make the completion source harder to reason about and break the minimal stock-cmdline contract. ## Proposed solution Keep modifier-value completion grounded and local for the stock `:Forge` cmdline. ### Global boundary Entering any `name=...` subtree disables forge entity-list completion/fetching for that request. Local discovery is still allowed. ### Modifier subtree contract - `repo=` - includes only locally derivable repo values - may include configured aliases, git remote names, resolved current / push / collaboration repo forms, and slug / hosted forms when derivable from those - may include multiple distinct valid user-facing forms even if they resolve to the same underlying repo (`origin`, `upstream`, `owner/repo`, `github.com/owner/repo`) - does **not** invent arbitrary placeholder hosted repo values - parser still accepts manually typed valid repo addresses - `template=` - may discover local issue template slugs - allowed on empty prefix - `head=` / `base=` - may complete local refs/tags, bounded recent short SHAs, and repo-qualified revision forms using `@...` - allowed on empty prefix - `branch=` / `commit=` - may complete local refs and bounded recent short SHAs - allowed on empty prefix - `target=` - may complete local/derived address scaffolds - allowed on empty prefix - `adapter=` - includes only actually available adapters (builtins plus registered adapters) - sorted alphabetically - does not synthesize config-only unavailable names - `method=` - stays purely static: `merge`, `squash`, `rebase` ### Scope note `repo=` remains the canonical scope override. No `remote=` modifier is introduced. Acceptance criteria: - entering any `name=...` subtree disables forge entity-list completion/fetching for that request - each modifier above follows the detailed subtree contract - local discovery remains allowed where appropriate - no forge entity fetching leaks into modifier-value completion - `repo=` remains the canonical scope override; no `remote=` modifier is introduced ## Alternatives considered - Replace `repo=` with `remote=` - Allow forge entity completion inside modifier-value subtrees - Synthesize config-only adapter names or arbitrary repo placeholders
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
barrettruth/forge.nvim#341
No description provided.