File tree Expand file tree Collapse file tree 3 files changed +40
-3
lines changed
Expand file tree Collapse file tree 3 files changed +40
-3
lines changed Original file line number Diff line number Diff line change 3030 " onCommand:PowerShell.NewProjectFromTemplate" ,
3131 " onCommand:PowerShell.OpenExamplesFolder" ,
3232 " onCommand:PowerShell.StartDebugSession" ,
33- " onCommand:PowerShell.PickPSHostProcess"
33+ " onCommand:PowerShell.PickPSHostProcess" ,
34+ " onCommand:PowerShell.SpecifyScriptArgs"
3435 ],
3536 "dependencies" : {
3637 "vscode-languageclient" : " 3.2.0"
175176 "program" : " ./out/debugAdapter.js" ,
176177 "runtime" : " node" ,
177178 "variables" : {
178- "PickPSHostProcess" : " PowerShell.PickPSHostProcess"
179+ "PickPSHostProcess" : " PowerShell.PickPSHostProcess" ,
180+ "SpecifyScriptArgs" : " PowerShell.SpecifyScriptArgs"
179181 },
180182 "languages" : [
181183 " powershell"
Original file line number Diff line number Diff line change @@ -106,6 +106,39 @@ export class DebugSessionFeature implements IFeature {
106106 }
107107}
108108
109+ export class SpecifyScriptArgsFeature implements IFeature {
110+
111+ private command : vscode . Disposable ;
112+ private languageClient : LanguageClient ;
113+
114+ constructor ( ) {
115+
116+ this . command =
117+ vscode . commands . registerCommand ( 'PowerShell.SpecifyScriptArgs' , ( ) => {
118+ return this . specifyScriptArguments ( ) ;
119+ } ) ;
120+ }
121+
122+ public setLanguageClient ( languageclient : LanguageClient ) {
123+ this . languageClient = languageclient ;
124+ }
125+
126+ public dispose ( ) {
127+ this . command . dispose ( ) ;
128+ }
129+
130+ private specifyScriptArguments ( ) : Thenable < string [ ] > {
131+ let options : vscode . InputBoxOptions = {
132+ ignoreFocusOut : true ,
133+ placeHolder : "Enter script arguments"
134+ }
135+
136+ return vscode . window . showInputBox ( options ) . then ( text => {
137+ return text !== undefined ? new Array ( text ) : text ;
138+ } ) ;
139+ }
140+ }
141+
109142interface ProcessItem extends vscode . QuickPickItem {
110143 pid : string ; // payload for the QuickPick UI
111144}
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ import { CodeActionsFeature } from './features/CodeActions';
2121import { RemoteFilesFeature } from './features/RemoteFiles' ;
2222import { DebugSessionFeature } from './features/DebugSession' ;
2323import { PickPSHostProcessFeature } from './features/DebugSession' ;
24+ import { SpecifyScriptArgsFeature } from './features/DebugSession' ;
2425import { SelectPSSARulesFeature } from './features/SelectPSSARules' ;
2526import { FindModuleFeature } from './features/PowerShellFindModule' ;
2627import { NewFileOrProjectFeature } from './features/NewFileOrProject' ;
@@ -113,7 +114,8 @@ export function activate(context: vscode.ExtensionContext): void {
113114 new DocumentFormatterFeature ( ) ,
114115 new RemoteFilesFeature ( ) ,
115116 new DebugSessionFeature ( ) ,
116- new PickPSHostProcessFeature ( )
117+ new PickPSHostProcessFeature ( ) ,
118+ new SpecifyScriptArgsFeature ( )
117119 ] ;
118120
119121 sessionManager =
You can’t perform that action at this time.
0 commit comments