8000 Add wildcard back to end of tab completion command lookup by TylerLeonhardt · Pull Request #9383 · PowerShell/PowerShell · GitHub
[go: up one dir, main page]

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ private static List<CompletionResult> CompleteCommand(CompletionContext context,

if (lastAst != null)
{
// We need to add the wildcard to the end so the regex is built correctly.
commandName += "*";

// Search the asts for function definitions that we might be calling
var findFunctionsVisitor = new FindFunctionsVisitor();
while (lastAst.Parent != null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,7 @@ Describe "TabCompletion" -Tags CI {
@{ inputStr = '$A=[datetime]::now;$A.'; expected = 'Date'; setup = $null }
@{ inputStr = 'try { 1/0 } catch {};$error[0].'; expected = 'CategoryInfo'; setup = $null }
@{ inputStr = '$x= gps pwsh;$x.*pm'; expected = 'NPM'; setup = $null }
@{ inputStr = 'function Get-ScrumData {}; Get-Scrum'; expected = 'Get-ScrumData'; setup = $null }
@{ inputStr = 'function write-output {param($abcd) $abcd};Write-Output -a'; expected = '-abcd'; setup = $null }
@{ inputStr = 'function write-output {param($abcd) $abcd};Microsoft.PowerShell.Utility\Write-Output -'; expected = '-InputObject'; setup = $null }
@{ inputStr = '[math]::Co'; expected = 'Cos('; setup = $null }
Expand Down
0