File tree Expand file tree Collapse file tree 2 files changed +18
-4
lines changed Expand file tree Collapse file tree 2 files changed +18
-4
lines changed Original file line number Diff line number Diff line change @@ -110,8 +110,10 @@ export class SpecifyScriptArgsFeature implements IFeature {
110
110
111
111
private command : vscode . Disposable ;
112
112
private languageClient : LanguageClient ;
113
+ private context : vscode . ExtensionContext ;
113
114
114
- constructor ( ) {
115
+ constructor ( context : vscode . ExtensionContext ) {
116
+ this . context = context ;
115
117
116
118
this . command =
117
119
vscode . commands . registerCommand ( 'PowerShell.SpecifyScriptArgs' , ( ) => {
@@ -128,13 +130,25 @@ export class SpecifyScriptArgsFeature implements IFeature {
128
130
}
129
131
130
132
private specifyScriptArguments ( ) : Thenable < string [ ] > {
133
+ const powerShellDbgScriptArgsKey = 'powerShellDebugScriptArgs' ;
134
+
131
135
let options : vscode . InputBoxOptions = {
132
136
ignoreFocusOut : true ,
133
- placeHolder : "Enter script arguments"
137
+ placeHolder : "Enter script arguments or leave empty to pass no args"
138
+ }
139
+
140
+ let prevArgs = this . context . globalState . get ( powerShellDbgScriptArgsKey , '' ) ;
141
+ if ( prevArgs . length > 0 ) {
142
+ options . value = prevArgs ;
134
143
}
135
144
136
145
return vscode . window . showInputBox ( options ) . then ( text => {
137
- return text !== undefined ? new Array ( text ) : text ;
146
+ if ( text !== undefined ) {
147
+ this . context . globalState . update ( powerShellDbgScriptArgsKey , text ) ;
148
+ return new Array ( text ) ;
149
+ }
150
+
151
+ return text ;
138
152
} ) ;
139
153
}
140
154
}
Original file line number Diff line number Diff line change @@ -115,7 +115,7 @@ export function activate(context: vscode.ExtensionContext): void {
115
115
new RemoteFilesFeature ( ) ,
116
116
new DebugSessionFeature ( ) ,
117
117
new PickPSHostProcessFeature ( ) ,
118
- new SpecifyScriptArgsFeature ( )
118
+ new SpecifyScriptArgsFeature ( context )
119
119
] ;
120
120
121
121
sessionManager =
You can’t perform that action at this time.
0 commit comments