@@ -80,6 +80,7 @@ export class DebugSessionFeature extends LanguageClientConsumer
80
80
: this . sessionManager . getSessionDetails ( ) ;
81
81
82
82
if ( sessionDetails === undefined ) {
83
+ // eslint-disable-next-line @typescript-eslint/no-floating-promises
83
84
this . logger . writeAndShowError ( `No session details available for ${ session . name } ` ) ;
84
85
return ;
85
86
}
@@ -101,15 +102,17 @@ export class DebugSessionFeature extends LanguageClientConsumer
101
102
languageClient . onNotification (
102
103
StartDebuggerNotificationType ,
103
104
// TODO: Use a named debug configuration.
104
- async ( ) => await vscode . debug . startDebugging ( undefined , {
105
+ // eslint-disable-next-line @typescript-eslint/no-misused-promises
106
+ ( ) => vscode . debug . startDebugging ( undefined , {
105
107
request : "launch" ,
106
108
type : "PowerShell" ,
107
109
name : "PowerShell: Interactive Session"
108
110
} ) ) ,
109
111
110
112
languageClient . onNotification (
111
113
StopDebuggerNotificationType ,
112
- async ( ) => await vscode . debug . stopDebugging ( undefined ) )
114
+ // eslint-disable-next-line @typescript-eslint/no-misused-promises
115
+ ( ) => vscode . debug . stopDebugging ( undefined ) )
113
116
] ;
114
117
}
115
118
@@ -188,7 +191,7 @@ export class DebugSessionFeature extends LanguageClientConsumer
188
191
189
192
if ( config . script === "${file}" || config . script === "${relativeFile}" ) {
190
193
if ( vscode . window . activeTextEditor === undefined ) {
191
- vscode . window . showErrorMessage ( "To debug the 'Current File', you must first open a PowerShell script file in the editor." ) ;
194
+ await vscode . window . showErrorMessage ( "To debug the 'Current File', you must first open a PowerShell script file in the editor." ) ;
192
195
return undefined ;
193
196
}
194
197
config . current_document = true ;
@@ -214,7 +217,7 @@ export class DebugSessionFeature extends LanguageClientConsumer
214
217
} else if ( config . request === "launch" ) {
215
218
resolvedConfig = await this . resolveLaunchDebugConfiguration ( config ) ;
216
219
} else {
217
- vscode . window . showErrorMessage ( `The request type was invalid: '${ config . request } '` ) ;
220
+ await vscode . window . showErrorMessage ( `The request type was invalid: '${ config . request } '` ) ;
218
221
return null ;
219
222
}
220
223
@@ -235,7 +238,7 @@ export class DebugSessionFeature extends LanguageClientConsumer
235
238
if ( config . current_document ) {
236
239
const currentDocument = vscode . window . activeTextEditor ?. document ;
237
240
if ( currentDocument ?. languageId !== "powershell" ) {
238
- vscode . window . showErrorMessage ( "Please change the current document's language mode to PowerShell." ) ;
241
+ await vscode . window . showErrorMessage ( "Please change the current document's language mode to PowerShell." ) ;
239
242
return undefined ;
240
243
}
241
244
}
@@ -244,13 +247,13 @@ export class DebugSessionFeature extends LanguageClientConsumer
244
247
// check the document extension for everything else.
245
248
if ( config . untitled_document ) {
246
249
if ( config . createTemporaryIntegratedConsole ) {
247
- vscode . window . showErrorMessage ( "Debugging untitled files in a temporary console is not supported." ) ;
250
+ await vscode . window . showErrorMessage ( "Debugging untitled files in a temporary console is not supported." ) ;
248
251
return undefined ;
249
252
}
250
253
} else if ( config . script ) {
251
254
const ext = path . extname ( config . script ) . toLowerCase ( ) ;
252
255
if ( ! ( ext === ".ps1" || ext === ".psm1" ) ) {
253
- vscode . window . showErrorMessage ( `PowerShell does not support debugging this file type: '${ path . basename ( config . script ) } '` ) ;
256
+ await vscode . window . showErrorMessage ( `PowerShell does not support debugging this file type: '${ path . basename ( config . script ) } '` ) ;
254
257
return undefined ;
255
258
}
256
259
}
@@ -262,13 +265,13 @@ export class DebugSessionFeature extends LanguageClientConsumer
262
265
const platformDetails = getPlatformDetails ( ) ;
263
266
const versionDetails = this . sessionManager . getPowerShellVersionDetails ( ) ;
264
267
if ( versionDetails === undefined ) {
265
- vscode . window . showErrorMessage ( `Session version details were not found for ${ config . name } ` ) ;
268
+ await vscode . window . showErrorMessage ( `Session version details were not found for ${ config . name } ` ) ;
266
269
return null ;
267
270
}
268
271
269
272
// Cross-platform attach to process was added in 6.2.0-preview.4.
270
273
if ( versionDetails . version < "7.0.0" && platformDetails . operatingSystem !== OperatingSystem . Windows ) {
271
- vscode . window . showErrorMessage ( `Attaching to a PowerShell Host Process on ${ OperatingSystem [ platformDetails . operatingSystem ] } requires PowerShell 7.0 or higher.` ) ;
274
+ await vscode . window . showErrorMessage ( `Attaching to a PowerShell Host Process on ${ OperatingSystem [ platformDetails . operatingSystem ] } requires PowerShell 7.0 or higher.` ) ;
272
275
return undefined ;
273
276
}
274
277
@@ -328,7 +331,7 @@ export class SpecifyScriptArgsFeature implements vscode.Disposable {
328
331
// When user cancel's the input box (by pressing Esc), the text value is undefined.
329
332
// Let's not blow away the previous setting.
330
333
if ( text !== undefined ) {
331
- this . context . workspaceState . update ( powerShellDbgScriptArgsKey , text ) ;
334
+ await this . context . workspaceState . update ( powerShellDbgScriptArgsKey , text ) ;
332
335
}
333
336
return text ;
334
337
}
@@ -393,6 +396,7 @@ export class PickPSHostProcessFeature extends LanguageClientConsumer {
393
396
( resolve , reject ) => {
394
397
this . getLanguageClientResolve = resolve ;
395
398
399
+ // eslint-disable-next-line @typescript-eslint/no-floating-promises
396
400
vscode . window
397
401
. showQuickPick (
398
402
[ "Cancel" ] ,
@@ -411,6 +415,7 @@ export class PickPSHostProcessFeature extends LanguageClientConsumer {
411
415
this . clearWaitingToken ( ) ;
412
416
reject ( ) ;
413
417
418
+ // eslint-disable-next-line @typescript-eslint/no-floating-promises
414
419
vscode . window . showErrorMessage (
415
420
"Attach to PowerShell host process: PowerShell session took too long to start." ) ;
416
421
}
@@ -519,6 +524,7 @@ export class PickRunspaceFeature extends LanguageClientConsumer {
519
524
( resolve , reject ) => {
520
525
this . getLanguageClientResolve = resolve ;
521
526
527
+ // eslint-disable-next-line @typescript-eslint/no-floating-promises
522
528
vscode . window
523
529
. showQuickPick (
524
530
[ "Cancel" ] ,
@@ -537,6 +543,7 @@ export class PickRunspaceFeature extends LanguageClientConsumer {
537
543
this . clearWaitingToken ( ) ;
538
544
reject ( ) ;
539
545
546
+ // eslint-disable-next-line @typescript-eslint/no-floating-promises
540
547
vscode . window . showErrorMessage (
541
548
"Attach to PowerShell host process: PowerShell session took too long to start." ) ;
542
549
}
0 commit comments