Replacement of ProjectManagerListener projectOpened()
Answered
Hello,
I've recently noticed that the projectOpened Method of the ProjectManagerListener is marked as deprecated and scheduled to be deleted but i can't find a replacement method anywhere. So how can i execute code when a project is opened in the future?
Please sign in to leave a comment.
Hi Daniel,
Did you check the page linked in the ProjectManagerListener.projectOpened Javadoc?
https://plugins.jetbrains.com/docs/intellij/plugin-components.html#project-open
yes i did and all interfaces linked (startupActivitiy) there are also either deprecated or obsolete
Not sure what you mean by that.
Quote from above page for 2023.1 and later
> Using Kotlin, implement
ProjectActivity
and register incom.intellij.postStartupActivity
extension point.Otherwise, you can use the alternatives listed on the other tab. Obsolete API is not a problem per se assuming you can't migrate to the alternative above (yet).
ProjectActivity
is not deprecated, but it requires Kotlin. If you can't use Kotlin, consider usingStartupActivity
, which is obsolete (not deprecated). Obsolete API may be subject to deprecation in the future, but can be used now if there are no alternatives.