@@ -114,64 +114,68 @@ export class PythonDebugConfigurationService implements IDebugConfigurationServi
114
114
input : MultiStepInput < DebugConfigurationState > ,
115
115
state : DebugConfigurationState ,
116
116
) : Promise < InputStep < DebugConfigurationState > | void > {
117
- type DebugConfigurationQuickPickItem = QuickPickItem & { type : DebugConfigurationType } ;
117
+ type DebugConfigurationQuickPickItemFunc = (
118
+ input : MultiStepInput < DebugConfigurationState > ,
119
+ state : DebugConfigurationState ,
120
+ ) => Promise < void | InputStep < DebugConfigurationState > > ;
121
+ type DebugConfigurationQuickPickItem = QuickPickItem & {
122
+ type : DebugConfigurationType ;
123
+ func : DebugConfigurationQuickPickItemFunc ;
124
+ } ;
118
125
const items : DebugConfigurationQuickPickItem [ ] = [
119
126
{
127
+ func : buildFileLaunchDebugConfiguration ,
120
128
label : DebugConfigStrings . file . selectConfiguration . label ,
121
129
type : DebugConfigurationType . launchFile ,
122
130
description : DebugConfigStrings . file . selectConfiguration . description ,
123
131
} ,
124
132
{
133
+ func : buildModuleLaunchConfiguration ,
125
134
label : DebugConfigStrings . module . selectConfiguration . label ,
126
135
type : DebugConfigurationType . launchModule ,
127
136
description : DebugConfigStrings . module . selectConfiguration . description ,
128
137
} ,
129
138
{
139
+ func : buildRemoteAttachConfiguration ,
130
140
label : DebugConfigStrings . attach . selectConfiguration . label ,
131
141
type : DebugConfigurationType . remoteAttach ,
132
142
description : DebugConfigStrings . attach . selectConfiguration . description ,
133
143
} ,
134
144
{
145
+ func : buildPidAttachConfiguration ,
135
146
label : DebugConfigStrings . attachPid . selectConfiguration . label ,
136
147
type : DebugConfigurationType . pidAttach ,
137
148
description : DebugConfigStrings . attachPid . selectConfiguration . description ,
138
149
} ,
139
150
{
151
+ func : buildDjangoLaunchDebugConfiguration ,
140
152
label : DebugConfigStrings . django . selectConfiguration . label ,
141
153
type : DebugConfigurationType . launchDjango ,
142
154
description : DebugConfigStrings . django . selectConfiguration . description ,
143
155
} ,
144
156
{
157
+ func : buildFastAPILaunchDebugConfiguration ,
145
158
label : DebugConfigStrings . fastapi . selectConfiguration . label ,
146
159
type : DebugConfigurationType . launchFastAPI ,
147
160
description : DebugConfigStrings . fastapi . selectConfiguration . description ,
148
161
} ,
149
162
{
163
+ func : buildFlaskLaunchDebugConfiguration ,
150
164
label : DebugConfigStrings . flask . selectConfiguration . label ,
151
165
type : DebugConfigurationType . launchFlask ,
152
166
description : DebugConfigStrings . flask . selectConfiguration . description ,
153
167
} ,
154
168
{
169
+ func : buildPyramidLaunchConfiguration ,
155
170
label : DebugConfigStrings . pyramid . selectConfiguration . label ,
156
171
type : DebugConfigurationType . launchPyramid ,
157
172
description : DebugConfigStrings . pyramid . selectConfiguration . description ,
158
173
} ,
159
174
] ;
160
- const debugConfigurations = new Map <
161
- DebugConfigurationType ,
162
- (
163
- input : MultiStepInput < DebugConfigurationState > ,
164
- state : DebugConfigurationState ,
165
- ) => Promise < void | InputStep < DebugConfigurationState > >
166
- > ( ) ;
167
- debugConfigurations . set ( DebugConfigurationType . launchDjango , buildDjangoLaunchDebugConfiguration ) ;
168
- debugConfigurations . set ( DebugConfigurationType . launchFastAPI , buildFastAPILaunchDebugConfiguration ) ;
169
- debugConfigurations . set ( DebugConfigurationType . launchFile , buildFileLaunchDebugConfiguration ) ;
170
- debugConfigurations . set ( DebugConfigurationType . launchFlask , buildFlaskLaunchDebugConfiguration ) ;
171
- debugConfigurations . set ( DebugConfigurationType . launchModule , buildModuleLaunchConfiguration ) ;
172
- debugConfigurations . set ( DebugConfigurationType . pidAttach , buildPidAttachConfiguration ) ;
173
- debugConfigurations . set ( DebugConfigurationType . remoteAttach , buildRemoteAttachConfiguration ) ;
174
- debugConfigurations . set ( DebugConfigurationType . launchPyramid , buildPyramidLaunchConfiguration ) ;
175
+ const debugConfigurations = new Map < DebugConfigurationType , DebugConfigurationQuickPickItemFunc > ( ) ;
176
+ for ( const config of items ) {
177
+ debugConfigurations . set ( config . type , config . func ) ;
178
+ }
175
179
176
180
state . config = { } ;
177
181
const pick = await input . showQuickPick <
0 commit comments