Skip to content

switching from IconManager to IconLoader#199

Open
adrienpessu wants to merge 2 commits intomainfrom
chore/change_deprecated_icon_method
Open

switching from IconManager to IconLoader#199
adrienpessu wants to merge 2 commits intomainfrom
chore/change_deprecated_icon_method

Conversation

@adrienpessu
Copy link
Copy Markdown
Collaborator

This pull request updates how icons are loaded in the SarifFileType object, switching from IconManager to IconLoader for improved compatibility and reliability.

@adrienpessu adrienpessu requested a review from Copilot February 16, 2026 14:36
Copy link
Copy Markdown

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 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(...) with IconLoader.getIcon(...) for the SARIF file type icon.
  • Add the IconLoader import to support the new icon-loading path.
Comments suppressed due to low confidence (1)

src/main/kotlin/com/github/adrienpessu/sarifviewer/SarifFileType.kt:10

  • IconManager and JBPanel imports appear unused in this file after switching to IconLoader. 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.

Comment on lines 39 to 41
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)
}
Copy link

Copilot AI Feb 16, 2026

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@copilot open a new pull request to apply changes based on this feedback

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 16, 2026

@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.

Copy link
Copy Markdown

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

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
Copy link

Copilot AI Feb 22, 2026

Choose a reason for hiding this comment

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

IconManager is no longer used after switching to IconLoader, so this import should be removed to avoid unused-import warnings/inspections.

Suggested change
import com.intellij.ui.IconManager

Copilot uses AI. Check for mistakes.
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