@@ -178,21 +178,10 @@ export class SpecifyScriptArgsFeature implements IFeature {
178
178
private command : vscode . Disposable ;
179
179
private languageClient : LanguageClient ;
180
180
private context : vscode . ExtensionContext ;
181
- private emptyInputBoxBugFixed : boolean ;
182
181
183
182
constructor ( context : vscode . ExtensionContext ) {
184
183
this . context = context ;
185
184
186
- const vscodeVersionArray = vscode . version . split ( "." ) ;
187
- const editorVersion = {
188
- major : Number ( vscodeVersionArray [ 0 ] ) ,
189
- minor : Number ( vscodeVersionArray [ 1 ] ) ,
190
- } ;
191
-
192
- this . emptyInputBoxBugFixed =
193
- ( ( editorVersion . major > 1 ) ||
194
- ( ( editorVersion . major === 1 ) && ( editorVersion . minor > 12 ) ) ) ;
195
-
196
185
this . command =
197
186
vscode . commands . registerCommand ( "PowerShell.SpecifyScriptArgs" , ( ) => {
198
187
return this . specifyScriptArguments ( ) ;
@@ -207,29 +196,24 @@ export class SpecifyScriptArgsFeature implements IFeature {
207
196
this . command . dispose ( ) ;
208
197
}
209
198
210
- private specifyScriptArguments ( ) : Thenable < string [ ] | string > {
199
+ private specifyScriptArguments ( ) : Thenable < string > {
211
200
const powerShellDbgScriptArgsKey = "powerShellDebugScriptArgs" ;
212
201
213
202
const options : vscode . InputBoxOptions = {
214
203
ignoreFocusOut : true ,
215
204
placeHolder : "Enter script arguments or leave empty to pass no args" ,
216
205
} ;
217
206
218
- if ( this . emptyInputBoxBugFixed ) {
219
- const prevArgs = this . context . workspaceState . get ( powerShellDbgScriptArgsKey , "" ) ;
220
- if ( prevArgs . length > 0 ) {
221
- options . value = prevArgs ;
222
- }
207
+ const prevArgs = this . context . workspaceState . get ( powerShellDbgScriptArgsKey , "" ) ;
208
+ if ( prevArgs . length > 0 ) {
209
+ options . value = prevArgs ;
223
210
}
224
211
225
212
return vscode . window . showInputBox ( options ) . then ( ( text ) => {
226
213
// When user cancel's the input box (by pressing Esc), the text value is undefined.
214
+ // Let's not blow away the previous settting.
227
215
if ( text !== undefined ) {
228
- if ( this . emptyInputBoxBugFixed ) {
229
- this . context . workspaceState . update ( powerShellDbgScriptArgsKey , text ) ;
230
- }
231
-
232
- return new Array ( text ) ;
216
+ this . context . workspaceState . update ( powerShellDbgScriptArgsKey , text ) ;
233
217
}
234
218
235
219
return text ;
0 commit comments