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 30
30
" onCommand:PowerShell.NewProjectFromTemplate" ,
31
31
" onCommand:PowerShell.OpenExamplesFolder" ,
32
32
" onCommand:PowerShell.StartDebugSession" ,
33
- " onCommand:PowerShell.PickPSHostProcess"
33
+ " onCommand:PowerShell.PickPSHostProcess" ,
34
+ " onCommand:PowerShell.SpecifyScriptArgs"
34
35
],
35
36
"dependencies" : {
36
37
"vscode-languageclient" : " 1.3.1"
175
176
"program" : " ./out/debugAdapter.js" ,
176
177
"runtime" : " node" ,
177
178
"variables" : {
178
- "PickPSHostProcess" : " PowerShell.PickPSHostProcess"
179
+ "PickPSHostProcess" : " PowerShell.PickPSHostProcess" ,
180
+ "SpecifyScriptArgs" : " PowerShell.SpecifyScriptArgs"
179
181
},
180
182
"languages" : [
181
183
" powershell"
Original file line number Diff line number Diff line change @@ -106,6 +106,39 @@ export class DebugSessionFeature implements IFeature {
106
106
}
107
107
}
108
108
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
+
109
142
interface ProcessItem extends vscode . QuickPickItem {
110
143
pid : string ; // payload for the QuickPick UI
111
144
}
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ import { CodeActionsFeature } from './features/CodeActions';
21
21
import { RemoteFilesFeature } from './features/RemoteFiles' ;
22
22
import { DebugSessionFeature } from './features/DebugSession' ;
23
23
import { PickPSHostProcessFeature } from './features/DebugSession' ;
24
+ import { SpecifyScriptArgsFeature } from './features/DebugSession' ;
24
25
import { SelectPSSARulesFeature } from './features/SelectPSSARules' ;
25
26
import { FindModuleFeature } from './features/PowerShellFindModule' ;
26
27
import { NewFileOrProjectFeature } from './features/NewFileOrProject' ;
@@ -113,7 +114,8 @@ export function activate(context: vscode.ExtensionContext): void {
113
114
new DocumentFormatterFeature ( ) ,
114
115
new RemoteFilesFeature ( ) ,
115
116
new DebugSessionFeature ( ) ,
116
- new PickPSHostProcessFeature ( )
117
+ new PickPSHostProcessFeature ( ) ,
118
+ new SpecifyScriptArgsFeature ( )
117
119
] ;
118
120
119
121
sessionManager =
You can’t perform that action at this time.
0 commit comments