Conversation
There was a problem hiding this comment.
Pull request overview
Updates icon loading for SarifFileType to use IntelliJ’s IconLoader rather than IconManager, aligning icon resolution with a more compatible/reliable API for plugin resources.
Changes:
- Replace
IconManager.getInstance().getIcon(...)withIconLoader.getIcon(...)for the SARIF file type icon. - Add the
IconLoaderimport to support the new icon-loading path.
Comments suppressed due to low confidence (1)
src/main/kotlin/com/github/adrienpessu/sarifviewer/SarifFileType.kt:10
IconManagerandJBPanelimports appear unused in this file after switching toIconLoader. Removing unused imports will prevent inspections/CI linting noise and keeps the file clean.
import com.intellij.openapi.util.IconLoader
import com.intellij.openapi.vfs.VirtualFile
import com.intellij.openapi.wm.ToolWindowManager
import com.intellij.ui.IconManager
import com.intellij.ui.components.JBPanel
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| private fun load(path: String, cacheKey: Int, flags: Int): Icon { | ||
| return IconManager.getInstance().getIcon(path, SarifFileType::class.java) | ||
| return IconLoader.getIcon(path, SarifFileType::class.java.classLoader) | ||
| } |
There was a problem hiding this comment.
cacheKey and flags are unused in load(...), and the method is private with only one call site. Consider simplifying the signature (and updating the call) to avoid misleading future readers and to satisfy unused-parameter inspections.
There was a problem hiding this comment.
@copilot open a new pull request to apply changes based on this feedback
|
@adrienpessu I've opened a new pull request, #200, to work on those changes. Once the pull request is ready, I'll request review from you. |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| import com.intellij.openapi.util.IconLoader | ||
| import com.intellij.openapi.vfs.VirtualFile | ||
| import com.intellij.openapi.wm.ToolWindowManager | ||
| import com.intellij.ui.IconManager |
There was a problem hiding this comment.
IconManager is no longer used after switching to IconLoader, so this import should be removed to avoid unused-import warnings/inspections.
| import com.intellij.ui.IconManager |
This pull request updates how icons are loaded in the
SarifFileTypeobject, switching fromIconManagertoIconLoaderfor improved compatibility and reliability.