Skip to content

Commit e535d5c

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

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
@@ -3872,17 +3872,22 @@ export async function activate(context: vscode.ExtensionContext) {
38723872
return;
38733873
}
38743874

3875-
// Process the first error if available
3876-
const errorMsg = espIdfDiagnostics[0].diagnostic.message;
3877-
const foundHint = await treeDataProvider.searchError(
3878-
errorMsg,
3879-
workspaceRoot
3880-
);
3875+
// Process all errors and collect hints
3876+
let foundAnyHint = false;
3877+
for (const { diagnostic } of espIdfDiagnostics) {
3878+
const foundHint = await treeDataProvider.searchError(
3879+
diagnostic.message,
3880+
workspaceRoot
3881+
);
3882+
if (foundHint) {
3883+
foundAnyHint = true;
3884+
}
3885+
}
38813886

38823887
const showHintsNotification = context.workspaceState.get(
38833888
"idf.showHintsNotification"
38843889
);
3885-
if (foundHint && showHintsNotification) {
3890+
if (foundAnyHint && showHintsNotification) {
38863891
const actions = [
38873892
{
38883893
label: vscode.l10n.t("💡 Show Hints"),
@@ -3902,7 +3907,7 @@ export async function activate(context: vscode.ExtensionContext) {
39023907
];
39033908

39043909
await showInfoNotificationWithMultipleActions(
3905-
vscode.l10n.t(`Possible hint found for the error: {0}`, errorMsg),
3910+
vscode.l10n.t(`Possible hints found for build errors. Click to view details.`),
39063911
actions
39073912
);
39083913
}

0 commit comments

Comments
 (0)