JustSid / AfterglowIntelliJ

IntelliJ version of the Afterglow Sublime Text theme
80 stars 11 forks source link

Icons missing after upgrade to 1.0.4 #9

Closed gicmo closed 8 years ago

gicmo commented 8 years ago

Hey!

After upgrading to version 1.0.4 I have a few broken icons. I am using IntelliJ 15.0.3, but it happens in CLion 1.2.4 too (I am running OSX 10.11.3), The JRE is the JetBrains bundled one (1.8.0_40...) . I think the python file icons should look different to, but they always looked like this.

Thanks a lot for creating the theme/plugin, I like it a lot!

JustSid commented 8 years ago

Whoops... I know that I broke this before, but I thought I had fixed it somehow. To be honest, I don't even know why it does it, so I guess I'll try to figure it out this time and then hopefully fix it for good. Thanks for bringing my attention to this :)

gicmo commented 8 years ago

The python file icons in some TreeViews, i.e. in the project outline, are changed with the installation of the python plugin in idea (without the python plugin they are the AfterGlow provided ones, after the installation they are the stock ones). So maybe the python plugin also provides a IconProvider and the icon comes from there. I didn't investigate that in the debugger, just a speculation.

JustSid commented 8 years ago

It doesn't appear to be an IconProvider issue, dumping the list of icon providers, Afterglow is the first one and it returns something for pretty much every file type so no other provider is asked. And indeed, it's asked for a Python icon and returns one. Doesn't appear to be a FileIconPatcher or FileIconProvider either. I'll leave this issue open for now for the Python icon issue.

gicmo commented 8 years ago

If you use CLion 1.5 EAP which has python support, the file-icons for python source files are also not the afterglow ones very much like IDEA with the python plugin installed.

JustSid commented 8 years ago

Yep, but like I said, it doesn't seem to have its own IconProvider and it does query Afterglow for the icon... It just ignores it somehow. I opened up the Python plugin itself, there is an Icon class where the file icon comes from. But I have yet to figure out where it's actually used (Show Usage sadly doesn't work for compiled classes).

JustSid commented 8 years ago

I finally found a fix! After stepping through the IntelliJ Community edition code, I figured out that there is yet another way to render file icons, via the AbstractPsiBaseNode class. This one doesn't have any direct way to change the icon, however, it provides the ProjectViewNodeDecorator extension point which can be used to decorate cells in the project view. Well, it also gets enough information to exchange the icon, and tada, that worked :)

I committed a fix already and I'm going to test if there are any performance regressions (especially on Windows) and probably release another update today if nothing else comes up.