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 {
110110
111111 private command : vscode . Disposable ;
112112 private languageClient : LanguageClient ;
113+ private context : vscode . ExtensionContext ;
113114
114- constructor ( ) {
115+ constructor ( context : vscode . ExtensionContext ) {
116+ this . context = context ;
115117
116118 this . command =
117119 vscode . commands . registerCommand ( 'PowerShell.SpecifyScriptArgs' , ( ) => {
@@ -128,13 +130,25 @@ export class SpecifyScriptArgsFeature implements IFeature {
128130 }
129131
130132 private specifyScriptArguments ( ) : Thenable < string [ ] > {
133+ const powerShellDbgScriptArgsKey = 'powerShellDebugScriptArgs' ;
134+
131135 let options : vscode . InputBoxOptions = {
132136 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 ;
134143 }
135144
136145 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 ;
138152 } ) ;
139153 }
140154}
Original file line number Diff line number Diff line change @@ -115,7 +115,7 @@ export function activate(context: vscode.ExtensionContext): void {
115115 new RemoteFilesFeature ( ) ,
116116 new DebugSessionFeature ( ) ,
117117 new PickPSHostProcessFeature ( ) ,
118- new SpecifyScriptArgsFeature ( )
118+ new SpecifyScriptArgsFeature ( context )
119119 ] ;
120120
121121 sessionManager =
You can’t perform that action at this time.
0 commit comments