Skip to content

fix: move filtering ignored issues to the LS [IDE-899]#278

Merged
rrama merged 10 commits intomainfrom
fix/issue-view-filtering
May 14, 2025
Merged

fix: move filtering ignored issues to the LS [IDE-899]#278
rrama merged 10 commits intomainfrom
fix/issue-view-filtering

Conversation

@rrama
Copy link
Copy Markdown
Contributor

@rrama rrama commented Mar 25, 2025

Description

Issue View Options filtering is moved to the Language Server.
This means that, if you disable viewing ignore issues:

  • the IDE will not receive ignored issues AT ALL.
  • the ignored issue will not appear in the issue tree.
  • the issue count will not show the ignored issues. (The text logic has been updated for this)
  • no yellow or red squiggly lines will be shown for the ignored issues.
  • no code actions will be shown for ignored issues.
  • etc.

The logic and text displayed in the issue trees has been majorly overhauled.

Expand to see new tree text outputs Some of the factors for this new logic are: number of issues, CCI FF, IVO states, code or non-code issue tree.

The top line (counts) can looks something like:

✅ Congrats! No issues found!
✅ Congrats! No open issues found!
✋ No ignored issues, open issues are disabled
Open and Ignored issues are disabled!
Open issues are disabled!
✋ {N} open issue(s) & {M} ignored issue(s)
✋ {N} open issue(s)
✋ {M} ignored issue(s), open issues are disabled
✋ {N} issue(s)

The second line (number of fixable issues or IVO prompt) can have the following:

Adjust your settings to view Open or Ignored issues.
Adjust your settings to view Open issues.
Adjust your settings to view Ignored issues.

⚡️ 1 open issue is fixable by Snyk DeepCode AI.
⚡️ 1 issue is fixable by Snyk DeepCode AI.
⚡️ 2 open issues are fixable by Snyk DeepCode AI.
⚡️ 2 issues are fixable by Snyk DeepCode AI.
There are no issues fixable by Snyk DeepCode AI.

Checklist

  • Tests added and all succeed
  • No tests added or changed, as there were none.
  • Linted
  • TODO!
  • CHANGELOG.md updated
  • TODO!
  • README.md updated, if user-facing
  • N/A

Screenshots / GIFs

Visuals that may help the reviewer. Please add screenshots for any UI change. GIFs are most welcome!

rrama added 3 commits March 25, 2025 16:46
Including updating the wording for issues found summaries since we now won't always know the count of open & ignored issues.
The LS will now ignore the Issue View Options when Code Consistent Ignores is not enabled in the org.
As such, the tree nodes have been updated to not display anything about IVOs when CCI is not enabled.
Fix some grammar and spelling mistakes.
Simplify the logic for the issues found text.
Add test for both open and ignored issues being off.
Fix lint error wanting use of StringBuilder.
@rrama rrama changed the title fix: WIP move filtering ignored issues to the LS [IDE-899] fix: move filtering ignored issues to the LS [IDE-899] Apr 17, 2025
@rrama rrama marked this pull request as ready for review April 17, 2025 17:57
@rrama rrama requested a review from a team as a code owner April 17, 2025 17:57
Comment thread plugin/src/main/java/io/snyk/eclipse/plugin/properties/IssueViewOptions.java Outdated
rrama added 3 commits April 30, 2025 17:27
Make the IVO settings sent to LS a record
Also made the tests slightly easier to debug.
long ignoredCount = issueCache.getIgnoredCount(productNode.getProduct());
long totalIssueCount = issueCache.getTotalCount(productNode.getProduct());
long ignoredIssueCount = issueCache.getIgnoredCount(productNode.getProduct());
long openIssueCount = totalIssueCount - ignoredIssueCount;
Copy link
Copy Markdown
Contributor

@ShawkyZ ShawkyZ May 5, 2025

Choose a reason for hiding this comment

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

long ignoredIssueCount = issueCache.getIgnoredCount(productNode.getProduct());
might be wrong here, since the issues might have been already be filtered in LS

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Added comments above to clarify.

Copy link
Copy Markdown
Contributor

@ShawkyZ ShawkyZ left a comment

Choose a reason for hiding this comment

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

long ignoredIssueCount = issueCache.getIgnoredCount(productNode.getProduct());
might be wrong here, since the issues might have been already be filtered in LS. Should we use IssueViewOption here instead?

String path = preferences.getPref(Preferences.PATH_KEY, "");
IssueViewOptions issueViewOptions = new IssueViewOptions(
preferences.getBooleanPref(Preferences.FILTER_IGNORES_SHOW_OPEN_ISSUES, true),
preferences.getBooleanPref(Preferences.FILTER_IGNORES_SHOW_IGNORED_ISSUES, false)
Copy link
Copy Markdown
Contributor

@ShawkyZ ShawkyZ May 5, 2025

Choose a reason for hiding this comment

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

should fallback be false here?
In LS default is true for IssueViewOptions.ignoredIssues

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I spoke with Andy, he wants all the IDEs to by default be only showing open issues (I need to raise a task to change some of the other IDEs). I didn't ask what the prefered default should be for a non-Snyk created IDE plugin (e.g. Neovim) which doesn't yet support the IVO settings should be, so I will need to do that.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Spoke with Andy and Costin, they said they want ignores disabled in the IDEs by default. I forgot to ask about the default for unofficial IDE plugins (e.g. Neovim) which don't have the setting coded in yet...

Copy link
Copy Markdown
Contributor Author

@rrama rrama May 9, 2025

Choose a reason for hiding this comment

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

I spoke with Andy and Costin about non-Snyk IDE plugins and have raised IDE-1169 to change the default in LS to not show ignored issues as well.

@snyk snyk deleted a comment from gemini-code-assist bot May 6, 2025
@rrama rrama requested review from a team and ShawkyZ May 8, 2025 14:05
Copy link
Copy Markdown
Contributor

@acke acke left a comment

Choose a reason for hiding this comment

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

Looks fantastic!

@rrama rrama merged commit d71f7f1 into main May 14, 2025
8 checks passed
@rrama rrama deleted the fix/issue-view-filtering branch May 14, 2025 14:24
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