fix: move filtering ignored issues to the LS [IDE-899]#278
Conversation
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.
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; |
There was a problem hiding this comment.
long ignoredIssueCount = issueCache.getIgnoredCount(productNode.getProduct());
might be wrong here, since the issues might have been already be filtered in LS
There was a problem hiding this comment.
Added comments above to clarify.
ShawkyZ
left a comment
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
should fallback be false here?
In LS default is true for IssueViewOptions.ignoredIssues
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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...
There was a problem hiding this comment.
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.
Description
Issue View Options filtering is moved to the Language Server.
This means that, if you disable viewing ignore issues:
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:
The second line (number of fixable issues or IVO prompt) can have the following:
Checklist
Screenshots / GIFs
Visuals that may help the reviewer. Please add screenshots for any UI change. GIFs are most welcome!