add-completion-source
Add an interactive-shell Tab completion source (provider) to ps-bash
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Add an interactive-shell Tab completion source (provider) to ps-bash
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Run the release-blocking Pester gate (tests/PsBash.Tests.ps1) the reliable way — build cmdlets, refresh beside-module DLLs, isolate PSModulePath from a stale installed PsBash, run Invoke-Pester.
Use (or extend) the shared PsBuild PowerShell-text builder and the OS-interface FileSystemHelpers/RunChildProcess helpers instead of hand-rolling PS strings or platform branches
Add a new bash command to the ps-bash transpiler and runtime
Add new grammar production to the bash parser (new token, AST node, or syntax)
Debug a bash command that produces wrong output or crashes in ps-bash
Rebuild and publish the local ps-bash exe for testing in opencode
| name | add-completion-source |
| description | Add an interactive-shell Tab completion source (provider) to ps-bash |
| disable-model-invocation | true |
文言:分上下文,置provider於CompletionEngine,呼運行時必設限,併以CompletionMerge,測之,更新spec。
Add a completion source for: $ARGUMENTS
Ref: @docs/specs/interactive-completion.md · rule: @.claude/rules/completion.md
Classify context. Decide WHERE the new candidates apply: command position
(TabCompleter.IsFirstWord), parameter name (-tok, PS cmdlet via GetCommandNameAtCursor
!IsBashCommand), parameter value (after -Flag, PreviousParamFlag), path, or a bash flag.Add the provider in CompletionEngine.CompleteAsync (src/PsBash.Host/Shell/). NOT in
LineEditor. One branch per context. Pure introspection where possible (no cursor mapping).
Bound every runspace call by the passed CancellationToken. Use _worker.QueryAsync(expr, ct)
or ICompletionWorker.CompleteInputAsync. Catch all; return empty on cancel/throw. Tab never hangs.
Merge with CompletionMerge.Append (sortSecondary true = append+sort; false = source-first).
Do NOT hand-roll a merge.
Single flag-spec source. If it's bash-command flags, it comes from
PsBash.Module/BashFlagSpecs.json via FlagSpecs. NEVER add a second flag table.
Test in src/PsBash.Host.Tests/Shell/CompletionEngineTests.cs with the FakeWorker
(IWorker [+ ICompletionWorker]): assert the merge, prefix re-filter, and a deterministic
cancel/fallback case (no sleeps). For live CompleteInput, add an SdkWorkerTests case.
Run: ./scripts/test.sh --filter CompletionEngine. Deploy: pwsh install-local.ps1.
Update the spec (docs/specs/interactive-completion.md): add the source to the context table.