Fix disappearing of Python repository from settings after Clion restart (CPP-7743)

Python plugin stored the interpreter setting as a module sdk, which was wiped out with it's order entries by Clion.
The fix is to store the interpreter setting in a facet and reinitialize it after Clion model clearing.
This commit is contained in:
Dmitry Trofimov
2017-02-15 16:03:33 +01:00
parent 298ccc4901
commit 30d86b98da
16 changed files with 466 additions and 95 deletions
@@ -238,7 +238,7 @@ public class PyActiveSdkConfigurable implements UnnamedConfigurable {
}
@Nullable
private Sdk getSdk() {
protected Sdk getSdk() {
if (myModule == null) {
return ProjectRootManager.getInstance(myProject).getProjectSdk();
}
@@ -302,7 +302,7 @@ public class PyActiveSdkConfigurable implements UnnamedConfigurable {
}
}
private void setSdk(final Sdk item) {
protected void setSdk(final Sdk item) {
ApplicationManager.getApplication().runWriteAction(() -> ProjectRootManager.getInstance(myProject).setProjectSdk(item));
if (myModule != null) {
ModuleRootModificationUtil.setModuleSdk(myModule, item);