Skip to content

Commit 675b284

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

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
@@ -3777,17 +3777,22 @@ export async function activate(context: vscode.ExtensionContext) {
37773777
return;
37783778
}
37793779

3780-
// Process the first error if available
3781-
const errorMsg = espIdfDiagnostics[0].diagnostic.message;
3782-
const foundHint = await treeDataProvider.searchError(
3783-
errorMsg,
3784-
workspaceRoot
3785-
);
3780+
// Process all errors and collect hints
3781+
let foundAnyHint = false;
3782+
for (const { diagnostic } of espIdfDiagnostics) {
3783+
const foundHint = await treeDataProvider.searchError(
3784+
diagnostic.message,
3785+
workspaceRoot
3786+
);
3787+
if (foundHint) {
3788+
foundAnyHint = true;
3789+
}
3790+
}
37863791

37873792
const showHintsNotification = context.workspaceState.get(
37883793
"idf.showHintsNotification"
37893794
);
3790-
if (foundHint && showHintsNotification) {
3795+
if (foundAnyHint && showHintsNotification) {
37913796
const actions = [
37923797
{
37933798
label: vscode.l10n.t("💡 Show Hints"),
@@ -3807,7 +3812,7 @@ export async function activate(context: vscode.ExtensionContext) {
38073812
];
38083813

38093814
await showInfoNotificationWithMultipleActions(
3810-
vscode.l10n.t(`Possible hint found for the error: {0}`, errorMsg),
3815+
vscode.l10n.t(`Possible hints found for build errors. Click to view details.`),
38113816
actions
38123817
);
38133818
}

0 commit comments

Comments
 (0)