Detect and use an SDK when using 'Import from existing sources' feature of PHPStorm


The golang plugin for IntelliJ bumped into a new issue :D
We've added support for non-IDEA IDEs but then there's a new issue that came up.
How can we detect that a new project created from existing sources should have the Go SDK enabled for it at import time?

Thank you.

Comment actions Permalink

Please check out com.intellij.projectImport.ProjectOpenProcessor

Comment actions Permalink

Hello Yann,

Thanks for the answer but unfortunately it's a bit too generic for me right now.
Could you please be more specific? I'm a total noob in this area (Java + IDEA plugins).

Also, happy holidays!

Thank you very much,

Comment actions Permalink

You need to provide an extension point in your plugin.xml to your implementation (extending com.intellij.projectImport.ProjectOpenProcessorBase)

<projectOpenProcessor id="EclipseProjectOpenProcessor" implementation="org.jetbrains.idea.eclipse.importWizard.EclipseProjectOpenProcessor"/>

For example, see org.jetbrains.idea.eclipse.importWizard.EclipseProjectOpenProcessor#doQuickImport, passed in argument com.intellij.ide.util.projectWizard.WizardContext can be used to manipulate initial project configuration.

Comment actions Permalink

Thank you very much for your help Yann!


Please sign in to leave a comment.