Closed ken-kuro closed 3 weeks ago
Thank you for taking the time to fix this. Very much appreciated ❤️ I have changed the target for this PR to be the 2024.2 branch, which contains the most recent version. You might want to rebase onto it to fix CI failures.
I have resolved the CI failures that were previously affecting this pull request. However, upon further review, I've determined that this pull request is addressing the same issue as #89. Furthermore, your recent commit at 9cb2f703e7ee75ae7d92ccd6b0fcf15719d52a5c appears to have already addressed this issue in a more elegant manner. As I am relatively new to Kotlin, the by lazy
construct was previously unfamiliar to me. Given these circumstances, I believe it would be prude to close this pull request.
Oh I thought that the changes you proposed were still necessary. Still very much appreciated that you took the time to prepare a PR 👍🏼
Hi there, Weis.
Recently, I encountered an error when opening the IDE. The error message (attached screenshot and stacktrace) indicates an issue with service initialization within the
IntellijNotificationService
class.Stacktrace Details
``` java.lang.Throwable: com.github.weisj.darkmode.IntellijNotificationServiceAfter some investigation, it appears the error is related to a change in IntelliJ behavior introduced in version 2024.2. You can find more details about this change here: https://youtrack.jetbrains.com/issue/IJPL-1045/Forbid-instance-requests-in-clinit.
This commit modifies the
IntellijNotificationService
class to address the aforementioned change. The service is now loaded on-demand within thedispatchNotification
function instead of during class initialization. This aligns with best practices for service retrieval as outlined in the IntelliJ documentation: https://plugins.jetbrains.com/docs/intellij/plugin-services.html#retrieving-a-serviceWhile I'm confident this change resolves the error, I'd appreciate your expert review of this commit.
I've been a big fan of this project since discovering it. Thank you for your continued development!