@@ -114,64 +114,68 @@ export class PythonDebugConfigurationService implements IDebugConfigurationServi
114114 input : MultiStepInput < DebugConfigurationState > ,
115115 state : DebugConfigurationState ,
116116 ) : 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+ } ;
118125 const items : DebugConfigurationQuickPickItem [ ] = [
119126 {
127+ func : buildFileLaunchDebugConfiguration ,
120128 label : DebugConfigStrings . file . selectConfiguration . label ,
121129 type : DebugConfigurationType . launchFile ,
122130 description : DebugConfigStrings . file . selectConfiguration . description ,
123131 } ,
124132 {
133+ func : buildModuleLaunchConfiguration ,
125134 label : DebugConfigStrings . module . selectConfiguration . label ,
126135 type : DebugConfigurationType . launchModule ,
127136 description : DebugConfigStrings . module . selectConfiguration . description ,
128137 } ,
129138 {
139+ func : buildRemoteAttachConfiguration ,
130140 label : DebugConfigStrings . attach . selectConfiguration . label ,
131141 type : DebugConfigurationType . remoteAttach ,
132142 description : DebugConfigStrings . attach . selectConfiguration . description ,
133143 } ,
134144 {
145+ func : buildPidAttachConfiguration ,
135146 label : DebugConfigStrings . attachPid . selectConfiguration . label ,
136147 type : DebugConfigurationType . pidAttach ,
137148 description : DebugConfigStrings . attachPid . selectConfiguration . description ,
138149 } ,
139150 {
151+ func : buildDjangoLaunchDebugConfiguration ,
140152 label : DebugConfigStrings . django . selectConfiguration . label ,
141153 type : DebugConfigurationType . launchDjango ,
142154 description : DebugConfigStrings . django . selectConfiguration . description ,
143155 } ,
144156 {
157+ func : buildFastAPILaunchDebugConfiguration ,
145158 label : DebugConfigStrings . fastapi . selectConfiguration . label ,
146159 type : DebugConfigurationType . launchFastAPI ,
147160 description : DebugConfigStrings . fastapi . selectConfiguration . description ,
148161 } ,
149162 {
163+ func : buildFlaskLaunchDebugConfiguration ,
150164 label : DebugConfigStrings . flask . selectConfiguration . label ,
151165 type : DebugConfigurationType . launchFlask ,
152166 description : DebugConfigStrings . flask . selectConfiguration . description ,
153167 } ,
154168 {
169+ func : buildPyramidLaunchConfiguration ,
155170 label : DebugConfigStrings . pyramid . selectConfiguration . label ,
156171 type : DebugConfigurationType . launchPyramid ,
157172 description : DebugConfigStrings . pyramid . selectConfiguration . description ,
158173 } ,
159174 ] ;
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+ }
175179
176180 state . config = { } ;
177181 const pick = await input . showQuickPick <
0 commit comments