@@ -80,6 +80,7 @@ export class DebugSessionFeature extends LanguageClientConsumer
8080 : this . sessionManager . getSessionDetails ( ) ;
8181
8282 if ( sessionDetails === undefined ) {
83+ // eslint-disable-next-line @typescript-eslint/no-floating-promises
8384 this . logger . writeAndShowError ( `No session details available for ${ session . name } ` ) ;
8485 return ;
8586 }
@@ -101,15 +102,17 @@ export class DebugSessionFeature extends LanguageClientConsumer
101102 languageClient . onNotification (
102103 StartDebuggerNotificationType ,
103104 // 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 , {
105107 request : "launch" ,
106108 type : "PowerShell" ,
107109 name : "PowerShell: Interactive Session"
108110 } ) ) ,
109111
110112 languageClient . onNotification (
111113 StopDebuggerNotificationType ,
112- async ( ) => await vscode . debug . stopDebugging ( undefined ) )
114+ // eslint-disable-next-line @typescript-eslint/no-misused-promises
115+ ( ) => vscode . debug . stopDebugging ( undefined ) )
113116 ] ;
114117 }
115118
@@ -188,7 +191,7 @@ export class DebugSessionFeature extends LanguageClientConsumer
188191
189192 if ( config . script === "${file}" || config . script === "${relativeFile}" ) {
190193 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." ) ;
192195 return undefined ;
193196 }
194197 config . current_document = true ;
@@ -214,7 +217,7 @@ export class DebugSessionFeature extends LanguageClientConsumer
214217 } else if ( config . request === "launch" ) {
215218 resolvedConfig = await this . resolveLaunchDebugConfiguration ( config ) ;
216219 } else {
217- vscode . window . showErrorMessage ( `The request type was invalid: '${ config . request } '` ) ;
220+ await vscode . window . showErrorMessage ( `The request type was invalid: '${ config . request } '` ) ;
218221 return null ;
219222 }
220223
@@ -235,7 +238,7 @@ export class DebugSessionFeature extends LanguageClientConsumer
235238 if ( config . current_document ) {
236239 const currentDocument = vscode . window . activeTextEditor ?. document ;
237240 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." ) ;
239242 return undefined ;
240243 }
241244 }
@@ -244,13 +247,13 @@ export class DebugSessionFeature extends LanguageClientConsumer
244247 // check the document extension for everything else.
245248 if ( config . untitled_document ) {
246249 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." ) ;
248251 return undefined ;
249252 }
250253 } else if ( config . script ) {
251254 const ext = path . extname ( config . script ) . toLowerCase ( ) ;
252255 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 ) } '` ) ;
254257 return undefined ;
255258 }
256259 }
@@ -262,13 +265,13 @@ export class DebugSessionFeature extends LanguageClientConsumer
262265 const platformDetails = getPlatformDetails ( ) ;
263266 const versionDetails = this . sessionManager . getPowerShellVersionDetails ( ) ;
264267 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 } ` ) ;
266269 return null ;
267270 }
268271
269272 // Cross-platform attach to process was added in 6.2.0-preview.4.
270273 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.` ) ;
272275 return undefined ;
273276 }
274277
@@ -328,7 +331,7 @@ export class SpecifyScriptArgsFeature implements vscode.Disposable {
328331 // When user cancel's the input box (by pressing Esc), the text value is undefined.
329332 // Let's not blow away the previous setting.
330333 if ( text !== undefined ) {
331- this . context . workspaceState . update ( powerShellDbgScriptArgsKey , text ) ;
334+ await this . context . workspaceState . update ( powerShellDbgScriptArgsKey , text ) ;
332335 }
333336 return text ;
334337 }
@@ -393,6 +396,7 @@ export class PickPSHostProcessFeature extends LanguageClientConsumer {
393396 ( resolve , reject ) => {
394397 this . getLanguageClientResolve = resolve ;
395398
399+ // eslint-disable-next-line @typescript-eslint/no-floating-promises
396400 vscode . window
397401 . showQuickPick (
398402 [ "Cancel" ] ,
@@ -411,6 +415,7 @@ export class PickPSHostProcessFeature extends LanguageClientConsumer {
411415 this . clearWaitingToken ( ) ;
412416 reject ( ) ;
413417
418+ // eslint-disable-next-line @typescript-eslint/no-floating-promises
414419 vscode . window . showErrorMessage (
415420 "Attach to PowerShell host process: PowerShell session took too long to start." ) ;
416421 }
@@ -519,6 +524,7 @@ export class PickRunspaceFeature extends LanguageClientConsumer {
519524 ( resolve , reject ) => {
520525 this . getLanguageClientResolve = resolve ;
521526
527+ // eslint-disable-next-line @typescript-eslint/no-floating-promises
522528 vscode . window
523529 . showQuickPick (
524530 [ "Cancel" ] ,
@@ -537,6 +543,7 @@ export class PickRunspaceFeature extends LanguageClientConsumer {
537543 this . clearWaitingToken ( ) ;
538544 reject ( ) ;
539545
546+ // eslint-disable-next-line @typescript-eslint/no-floating-promises
540547 vscode . window . showErrorMessage (
541548 "Attach to PowerShell host process: PowerShell session took too long to start." ) ;
542549 }
0 commit comments