@@ -15,9 +15,9 @@ import showInformationMessage from '../../../shared/observers/utils/showInformat
15
15
import showErrorMessage from '../../../observers/utils/showErrorMessage' ;
16
16
17
17
export class BlazorDebugConfigurationProvider implements vscode . DebugConfigurationProvider {
18
- private static readonly autoDetectUserNotice = `Run and Debug: auto-detection found {0} for a launch browser` ;
19
- private static readonly edgeBrowserType = 'msedge' ;
20
- private static readonly chromeBrowserType = 'chrome' ;
18
+ private static readonly autoDetectUserNotice : string = `Run and Debug: auto-detection found {0} for a launch browser` ;
19
+ private static readonly edgeBrowserType : string = 'msedge' ;
20
+ private static readonly chromeBrowserType : string = 'chrome' ;
21
21
22
22
constructor ( private readonly logger : RazorLogger , private readonly vscodeType : typeof vscode ) { }
23
23
@@ -172,21 +172,27 @@ export class BlazorDebugConfigurationProvider implements vscode.DebugConfigurati
172
172
}
173
173
}
174
174
175
- public static async determineBrowserType ( ) {
175
+ public static async determineBrowserType ( ) : Promise < string | undefined > {
176
176
// There was no browser specified by the user, so we will do some auto-detection to find a browser,
177
177
// favoring chrome if multiple valid options are installed.
178
178
const chromeBrowserFinder = new ChromeBrowserFinder ( process . env , promises , null ) ;
179
179
const chromeInstallations = await chromeBrowserFinder . findAll ( ) ;
180
180
if ( chromeInstallations . length > 0 ) {
181
- showInformationMessage ( vscode , this . autoDetectUserNotice . replace ( '{0}' , `'Chrome'` ) ) ;
182
- return this . chromeBrowserType ;
181
+ showInformationMessage (
182
+ vscode ,
183
+ BlazorDebugConfigurationProvider . autoDetectUserNotice . replace ( '{0}' , `'Chrome'` )
184
+ ) ;
185
+ return BlazorDebugConfigurationProvider . chromeBrowserType ;
183
186
}
184
187
185
188
const edgeBrowserFinder = new EdgeBrowserFinder ( process . env , promises , null ) ;
186
189
const edgeInstallations = await edgeBrowserFinder . findAll ( ) ;
187
190
if ( edgeInstallations . length > 0 ) {
188
- showInformationMessage ( vscode , this . autoDetectUserNotice . replace ( '{0}' , `'Edge'` ) ) ;
189
- return this . edgeBrowserType ;
191
+ showInformationMessage (
192
+ vscode ,
193
+ BlazorDebugConfigurationProvider . autoDetectUserNotice . replace ( '{0}' , `'Edge'` )
194
+ ) ;
195
+ return BlazorDebugConfigurationProvider . edgeBrowserType ;
190
196
}
191
197
192
198
showErrorMessage ( vscode , 'Run and Debug: A valid browser is not installed' ) ;
0 commit comments