Skip to content

Commit 65efe87

Browse files
committed
fix: display one generic notification
Before this fix, if there were multiple hints matches, there would be multiple notifications
1 parent 2934402 commit 65efe87

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

src/extension.ts

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3764,17 +3764,22 @@ export async function activate(context: vscode.ExtensionContext) {
37643764
return;
37653765
}
37663766

3767-
// Process the first error if available
3768-
const errorMsg = espIdfDiagnostics[0].diagnostic.message;
3769-
const foundHint = await treeDataProvider.searchError(
3770-
errorMsg,
3771-
workspaceRoot
3772-
);
3767+
// Process all errors and collect hints
3768+
let foundAnyHint = false;
3769+
for (const { diagnostic } of espIdfDiagnostics) {
3770+
const foundHint = await treeDataProvider.searchError(
3771+
diagnostic.message,
3772+
workspaceRoot
3773+
);
3774+
if (foundHint) {
3775+
foundAnyHint = true;
3776+
}
3777+
}
37733778

37743779
const showHintsNotification = context.workspaceState.get(
37753780
"idf.showHintsNotification"
37763781
);
3777-
if (foundHint && showHintsNotification) {
3782+
if (foundAnyHint && showHintsNotification) {
37783783
const actions = [
37793784
{
37803785
label: vscode.l10n.t("💡 Show Hints"),
@@ -3794,7 +3799,7 @@ export async function activate(context: vscode.ExtensionContext) {
37943799
];
37953800

37963801
await showInfoNotificationWithMultipleActions(
3797-
vscode.l10n.t(`Possible hint found for the error: {0}`, errorMsg),
3802+
vscode.l10n.t(`Possible hints found for build errors. Click to view details.`),
37983803
actions
37993804
);
38003805
}

0 commit comments

Comments
 (0)