Add completion for variables assigned by the Data statement (#19831)

This commit is contained in:
MartinGC94
2023-07-10 17:15:05 -07:00
committed by GitHub
parent d9fff5bea9
commit ac87d2ae0e
2 changed files with 21 additions and 0 deletions
@@ -657,6 +657,12 @@ ConstructorTestClass(int i, bool b)
$res.CompletionMatches[0].CompletionText | Should -BeExactly Cat
}
It 'Should complete variable assigned with Data statement' {
$TestString = 'data MyDataVar {"Hello"};$MyDatav'
$res = TabExpansion2 -inputScript $TestString
$res.CompletionMatches[0].CompletionText | Should -BeExactly '$MyDataVar'
}
it 'Should complete "Value" parameter value in "Where-Object" for Enum property with no input' {
$res = TabExpansion2 -inputScript 'Get-Command | where-Object CommandType -eq '
$res.CompletionMatches[0].CompletionText | Should -BeExactly Alias