Skip to content

"Ignore" to unflag all occurrences#45

Merged
cyanzhong merged 3 commits intomainfrom
copilot/fix-ignore-functionality
Mar 17, 2026
Merged

"Ignore" to unflag all occurrences#45
cyanzhong merged 3 commits intomainfrom
copilot/fix-ignore-functionality

Conversation

Copy link
Contributor

Copilot AI commented Mar 16, 2026

Clicking "Ignore" on a flagged word only dismissed that single occurrence. Other identical flagged words remained highlighted despite the word being added to the dictionary.

  • Changed ignoreDiagnostic filter predicate from positional matching (from/to) to semantic matching by problemText only (lint kind is not checked, since the word is added to the dictionary regardless of kind)
  • When problemText is empty, falls back to positional matching (from/to/lintKind) to avoid over-removing unrelated diagnostics
  • Added unit tests for ignoreDiagnostic covering: all same-text removal, cross-kind removal, different-text preservation, and empty-text positional fallback
- !(d.from === diag.from && d.to === diag.to && d.lintKind === diag.lintKind),
+ diag.problemText
+   ? d.problemText !== diag.problemText
+   : !(d.from === diag.from && d.to === diag.to && d.lintKind === diag.lintKind),

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits March 16, 2026 05:43
Co-authored-by: cyanzhong <6745066+cyanzhong@users.noreply.github.com>
@cyanzhong cyanzhong changed the title Fix "Ignore" to unflag all occurrences of the same word Fix "Ignore" to unflag all occurrences Mar 16, 2026
@cyanzhong cyanzhong changed the title Fix "Ignore" to unflag all occurrences "Ignore" to unflag all occurrences Mar 16, 2026
@cyanzhong cyanzhong requested a review from Copilot March 16, 2026 12:00
@cyanzhong cyanzhong marked this pull request as ready for review March 16, 2026 12:00
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the “Ignore” behavior in the diagnostic card helpers so that ignoring a flagged word can clear all matching occurrences (by text + lint kind), aligning UI highlights with dictionary additions.

Changes:

  • Change ignoreDiagnostic filtering from positional matching (from/to) to semantic matching (problemText/lintKind).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

@cyanzhong
Copy link
Contributor

@copilot Do we need to check kind?

…iagnostic tests

Co-authored-by: cyanzhong <6745066+cyanzhong@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Mar 16, 2026

@copilot Do we need to check kind?

No, we don't need to check kind. Since the word gets added to the dictionary, Harper won't flag it under any lint kind in the future. Updated to match by problemText only, with a positional fallback for empty problemText. See 7bf15f5.

Copilot AI requested a review from cyanzhong March 16, 2026 12:34
@cyanzhong cyanzhong merged commit 588f262 into main Mar 17, 2026
1 check passed
@cyanzhong cyanzhong deleted the copilot/fix-ignore-functionality branch March 17, 2026 07:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants