Skip to content

Commit 813874f

Browse files
committed
Fix browserlist parameter & log browsers list
1 parent 4552a8d commit 813874f

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/browser-compatibility-checker/message.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { CompatIssue } from "./compat-issues";
22

3-
const BROWSER_NAMES: { [key: string]: string } = {
3+
export const BROWSER_NAMES: { [key: string]: string } = {
44
chrome: "Chrome",
55
edge: "Edge",
66
firefox: "Firefox",

src/extension.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {
55
getBrowsersList,
66
} from "./browser-compatibility-checker";
77
import { minimatch } from "minimatch";
8+
import { BROWSER_NAMES } from "./browser-compatibility-checker/message";
89

910
const compatIssues: {
1011
[path: string]: { [key: string]: CompatIssue };
@@ -93,14 +94,16 @@ export function activate(context: vscode.ExtensionContext) {
9394
const vscodeConfig = vscode.workspace.getConfiguration(
9495
"browser-compatibility-checker",
9596
);
96-
let browsersToCheck = vscodeConfig.browsersToCheck;
97+
let browsersToCheck: string[] = vscodeConfig.browserList;
9798
if (vscode.workspace.workspaceFolders) {
9899
const detectedBrowsersList = getBrowsersList(
99100
vscode.workspace.workspaceFolders![0].uri.fsPath,
100101
);
101102
if (detectedBrowsersList && detectedBrowsersList.length > 0) {
102-
vscode.window.showInformationMessage("Using detected browserslist");
103+
vscode.window.showInformationMessage(`Using detected browserslist: ${detectedBrowsersList.map(x => BROWSER_NAMES[x] || x).join(', ')}`);
103104
browsersToCheck = detectedBrowsersList;
105+
} else {
106+
vscode.window.showInformationMessage(`Using browser list: ${browsersToCheck.map(x => BROWSER_NAMES[x] || x).join(', ')}`);
104107
}
105108
}
106109
const config: Config = {

0 commit comments

Comments
 (0)