Skip to content

Commit 58a7151

Browse files
authored
Fix static variables used in determineBrowserType (#5919)
This PR fixes the 'this' to be 'BlazorDebugConfigurationProvider' for the new static variables from #5911
1 parent f01115f commit 58a7151

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

src/razor/src/blazorDebug/blazorDebugConfigurationProvider.ts

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ import showInformationMessage from '../../../shared/observers/utils/showInformat
1515
import showErrorMessage from '../../../observers/utils/showErrorMessage';
1616

1717
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';
2121

2222
constructor(private readonly logger: RazorLogger, private readonly vscodeType: typeof vscode) {}
2323

@@ -172,21 +172,27 @@ export class BlazorDebugConfigurationProvider implements vscode.DebugConfigurati
172172
}
173173
}
174174

175-
public static async determineBrowserType() {
175+
public static async determineBrowserType(): Promise<string | undefined> {
176176
// There was no browser specified by the user, so we will do some auto-detection to find a browser,
177177
// favoring chrome if multiple valid options are installed.
178178
const chromeBrowserFinder = new ChromeBrowserFinder(process.env, promises, null);
179179
const chromeInstallations = await chromeBrowserFinder.findAll();
180180
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;
183186
}
184187

185188
const edgeBrowserFinder = new EdgeBrowserFinder(process.env, promises, null);
186189
const edgeInstallations = await edgeBrowserFinder.findAll();
187190
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;
190196
}
191197

192198
showErrorMessage(vscode, 'Run and Debug: A valid browser is not installed');

0 commit comments

Comments
 (0)