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

Hello,


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.

4 comments
Comment actions Permalink

Please check out com.intellij.projectImport.ProjectOpenProcessor


0
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,
Florin

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

0
Comment actions Permalink

Thank you very much for your help Yann!

0

Please sign in to leave a comment.