Skip to content

Rename prefix/requestPrefix to input in completion APIs#2105

Merged
curtisman merged 2 commits intomicrosoft:mainfrom
curtisman:rename
Mar 30, 2026
Merged

Rename prefix/requestPrefix to input in completion APIs#2105
curtisman merged 2 commits intomicrosoft:mainfrom
curtisman:rename

Conversation

@curtisman
Copy link
Copy Markdown
Member

Rename the parameter representing user input text from prefix and requestPrefix to input across the completion call chain for clarity and consistency with how callers and grammarMatcher.ts already name this concept.

Changes

  • grammarCompletion.ts: All function parameters (matchGrammarCompletion, collectCandidates, mergeSepMode, matchKeywordWordsFrom, findPartialKeywordInWildcard, tryPartialStringMatch) and CompletionContext.input field
  • grammarStore.ts, cache.ts, constructionStore.ts, constructionCache.ts: completion() method parameters
  • requestCompletion.ts: requestCompletion() parameter
  • matchCommandHandler.ts, requestCommandHandler.ts, translateCommandHandler.ts: Local variables
  • completion.md: Documentation signature

Motivation

The old name prefix was ambiguous — it could mean a substring prefix of something, when it actually represents the user's input text up to the cursor. The new name input is:

  • Consistent with how callers already named the variable (args.input in CLI, input in tests)
  • Clearer about what the parameter represents
  • Aligned with grammarMatcher.ts which uses request for the same concept in the match path

Rename the parameter representing user input text from 'prefix' and
'requestPrefix' to 'input' across the completion call chain for clarity
and consistency:

- grammarCompletion.ts: all function params and CompletionContext field
- grammarStore.ts, cache.ts, constructionStore.ts, constructionCache.ts:
  completion() method parameters
- requestCompletion.ts: requestCompletion() parameter
- matchCommandHandler.ts, requestCommandHandler.ts,
  translateCommandHandler.ts: local variables
- completion.md: documentation signature
@curtisman curtisman added this pull request to the merge queue Mar 30, 2026
Merged via the queue into microsoft:main with commit 1668366 Mar 30, 2026
13 of 15 checks passed
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.

1 participant