Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix IDEA IC support (fixes #507) #515

Merged
merged 1 commit into from Jan 8, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 13 additions & 4 deletions src/ro/redeul/google/go/template/GoTemplatesFactory.java
Expand Up @@ -2,6 +2,7 @@

import com.intellij.ide.util.projectWizard.WizardContext;
import com.intellij.openapi.module.WebModuleBuilder;
import com.intellij.openapi.module.WebModuleType;
import com.intellij.platform.ProjectTemplate;
import com.intellij.platform.ProjectTemplatesFactory;
import org.jetbrains.annotations.NotNull;
Expand All @@ -11,14 +12,22 @@ public class GoTemplatesFactory extends ProjectTemplatesFactory {
@NotNull
@Override
public String[] getGroups() {
return new String[]{WebModuleBuilder.GROUP_NAME};
return new String[]{WebModuleBuilder.GROUP_NAME};
}

@NotNull
@Override
public ProjectTemplate[] createTemplates(String group, WizardContext context) {
return new ProjectTemplate[]{
new GoApplicationGenerator()
};

// Hack to support IDEA IC and non-IDEA
try {
WebModuleType module = WebModuleType.getInstance();
} catch (Exception ignored) {
return ProjectTemplate.EMPTY_ARRAY;
}

return new ProjectTemplate[]{
new GoApplicationGenerator()
};
}
}