@@ -35,21 +35,25 @@ export function makeFailedWriteMessage(filename: string): string {
3535 return message
3636}
3737
38- function showMessageWithItems (
39- message : string ,
38+ export function showMessage (
4039 kind : 'info' | 'warn' | 'error' = 'error' ,
40+ message : string ,
4141 items : string [ ] = [ ] ,
42- useModal : boolean = false
42+ options : vscode . MessageOptions & { telemetry ?: boolean } = { }
4343) : Thenable < string | undefined > {
44- switch ( kind ) {
45- case 'info' :
46- return vscode . window . showInformationMessage ( message , { modal : useModal } , ...items )
47- case 'warn' :
48- return vscode . window . showWarningMessage ( message , { modal : useModal } , ...items )
49- case 'error' :
50- default :
51- return vscode . window . showErrorMessage ( message , { modal : useModal } , ...items )
52- }
44+ return telemetry . toolkit_showNotification . run ( async ( span ) => {
45+ span . record ( { passive : true } )
46+
47+ switch ( kind ) {
48+ case 'info' :
49+ return vscode . window . showInformationMessage ( message , options , ...items )
50+ case 'warn' :
51+ return vscode . window . showWarningMessage ( message , options , ...items )
52+ case 'error' :
53+ default :
54+ return vscode . window . showErrorMessage ( message , options , ...items )
55+ }
56+ } )
5357}
5458
5559/**
@@ -75,7 +79,7 @@ export async function showMessageWithUrl(
7579 const uri = typeof url === 'string' ? vscode . Uri . parse ( url ) : url
7680 const items = [ ...extraItems , urlItem ]
7781
78- const p = showMessageWithItems ( message , kind , items , useModal )
82+ const p = showMessage ( kind , message , items , { modal : useModal } )
7983 return p . then < string | undefined > ( ( selection ) => {
8084 if ( selection === urlItem ) {
8185 void openUrl ( uri )
@@ -102,7 +106,7 @@ export async function showViewLogsMessage(
102106 const logsItem = localize ( 'AWS.generic.message.viewLogs' , 'View Logs...' )
103107 const items = [ ...extraItems , logsItem ]
104108
105- const p = showMessageWithItems ( message , kind , items )
109+ const p = showMessage ( kind , message , items )
106110 return p . then < string | undefined > ( ( selection ) => {
107111 if ( selection === logsItem ) {
108112 globals . logOutputChannel . show ( true )
0 commit comments