-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Description
Summary of the new feature / enhancement
I am currently developing PowerShell Module for external command completion using Register-ArgumentCompleter -NativeFallback (#25230) . I encountered a problem during development.
When completing a certain parameter, if there are no completion candidates and an empty IEnumerable<CompletionResult> is returned, it falls back to filename completion.
I would like to be able to control whether or not it falls back to filename completion.
Proposed technical implementation details (optional)
There are two ideas.
A)
During NativeFallback completion, do not fall back to filename completion.
If you want to perform filename completion, manually call [System.Management.Automation.CompletionCompleters]::CompleteFilename($wordToComplete).
B)
Stop completion when a special CompletionResult (*1) is received.
*1: like CompletionResult.Null (However, this is an internal access modifier and cannot be used externally)
PowerShell/src/System.Management.Automation/engine/CommandCompletion/CompletionResult.cs
Lines 154 to 160 in ba02868
| /// <summary> | |
| /// Gets the null instance of type CompletionResult. | |
| /// </summary> | |
| internal static CompletionResult Null | |
| { | |
| get { return s_nullInstance; } | |
| } |