feat: enhance HTML settings page with full IDE configuration support [IDE-1625]#348
feat: enhance HTML settings page with full IDE configuration support [IDE-1625]#348nick-y-snyk merged 7 commits intomainfrom
Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
| @Override | ||
| public void dispose() { | ||
| if (instance == this) { | ||
| instance = null; |
Check warning
Code scanning / PMD
Assigning an Object to null is a code smell. Consider refactoring. Warning
- Add comprehensive IdeConfigData class with typed nested structures for all settings - Implement retry logic (2 attempts, 2s delay) for loading LS HTML before fallback - Add FolderConfig support with additionalEnv, additionalParameters, and scanCommandConfig - Implement auth token notification to HTML page after successful authentication - Fix UI hang by making updateConfiguration async in performOk - Fix 10s timeout by checking LS connection before executeCommand in getConfigHtml - Improve button styling with proper colors and contrast in BaseHtmlProvider - Add static instance tracking for auth token callback from hasAuthenticated event
14e28fd to
f5115e3
Compare
- Extract duplicate string literal "#FFFFFF" to constant in BaseHtmlProvider - Mark static instance field as volatile for thread safety in HTMLSettingsPreferencePage - Extract loop logic into helper methods to avoid object instantiation in loops - Replace reference equality (==) with equals() for object comparison - Isolate null assignment in dedicated clearInstance() method
| if (commandService != null) { | ||
| // Refresh severity filter commands | ||
| commandService.refreshElements( | ||
| "io.snyk.eclipse.plugin.commands.snykFilterCritical", null); |
There was a problem hiding this comment.
I wonder if we can use constants here that are synchronized with the plugin.xml definition, so we have compile-time validation and consistency.
There was a problem hiding this comment.
was there any resolution to this?
There was a problem hiding this comment.
... and what is the resolution? please expand and point me to the solution.
- Replace fully qualified class name with import for HTMLSettingsPreferencePage - Replace hardcoded command ID strings with constants from IHandlerCommands - Fix theme constant usage: use proper Eclipse workbench colors instead of hyperlink colors for buttons - Convert IdeConfigData and inner classes to Java records (eliminates ~300 lines of boilerplate) - Remove unnecessary clearInstance() method in HTMLSettingsPreferencePage - Add synchronization to prevent race conditions between login and logout operations
| new ScanCommandConfig( | ||
| configData.preScanCommand(), | ||
| Boolean.TRUE.equals(configData.preScanOnlyReferenceFolder()), | ||
| configData.postScanCommand(), | ||
| Boolean.TRUE.equals(configData.postScanOnlyReferenceFolder())); |
Check warning
Code scanning / PMD
Avoid instantiating new objects inside loops Warning
f063812 to
934be4b
Compare
Summary
Changes
Button Styling (BaseHtmlProvider.java)
Settings Page Refactor (HTMLSettingsPreferencePage.java)
Test plan