@@ -104,6 +104,34 @@ Describe "TabCompletion" -Tags CI {
104
104
$res = TabExpansion2 - inputScript ' param($PS = $P'
105
105
$res.CompletionMatches.Count | Should - BeGreaterThan 0
106
106
}
107
+
108
+ It ' Should complete variable with description and value <Value>' - TestCases @ (
109
+ @ { Value = 1 ; Expected = ' [int]$VariableWithDescription - Variable description' }
110
+ @ { Value = ' string' ; Expected = ' [string]$VariableWithDescription - Variable description' }
111
+ @ { Value = $null ; Expected = ' VariableWithDescription - Variable description' }
112
+ ) {
113
+ param ($Value , $Expected )
114
+
115
+ New-Variable - Name VariableWithDescription - Value $Value - Description ' Variable description' - Force
116
+ $res = TabExpansion2 - inputScript ' $VariableWithDescription'
117
+ $res.CompletionMatches.Count | Should - Be 1
118
+ $res.CompletionMatches [0 ].CompletionText | Should - BeExactly ' $VariableWithDescription'
119
+ $res.CompletionMatches [0 ].ToolTip | Should - BeExactly $Expected
120
+ }
121
+
122
+ It ' Should complete scoped variable with description and value <Value>' - TestCases @ (
123
+ @ { Value = 1 ; Expected = ' [int]$VariableWithDescription - Variable description' }
124
+ @ { Value = ' string' ; Expected = ' [string]$VariableWithDescription - Variable description' }
125
+ @ { Value = $null ; Expected = ' VariableWithDescription - Variable description' }
126
+ ) {
127
+ param ($Value , $Expected )
128
+
129
+ New-Variable - Name VariableWithDescription - Value $Value - Description ' Variable description' - Force
130
+ $res = TabExpansion2 - inputScript ' $local:VariableWithDescription'
131
+ $res.CompletionMatches.Count | Should - Be 1
132
+ $res.CompletionMatches [0 ].CompletionText | Should - BeExactly ' $local:VariableWithDescription'
133
+ $res.CompletionMatches [0 ].ToolTip | Should - BeExactly $Expected
134
+ }
107
135
108
136
It ' Should not complete property name in class definition' {
109
137
$res = TabExpansion2 - inputScript ' class X {$P'
0 commit comments