Skip to content

Commit fcd4249

Browse files
committed
add simple go project generator for small IDEs, fix #1763
1 parent 8164846 commit fcd4249

File tree

2 files changed

+63
-0
lines changed

2 files changed

+63
-0
lines changed

src/META-INF/plugin.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,8 @@
128128
<analyzeStacktraceFilter implementation="com.goide.runconfig.GoConsoleFilter"/>
129129
<lang.implementationTextSelectioner language="go" implementationClass="com.goide.editor.GoImplementationTextSelectioner"/>
130130

131+
<directoryProjectGenerator implementation="com.goide.GoProjectGenerator"/> <!-- for small IDEs-->
132+
131133
<!--formatter-->
132134
<lang.formatter language="go" implementationClass="com.goide.formatter.GoFormattingModelBuilder"/>
133135
<codeStyleSettingsProvider implementation="com.goide.formatter.settings.GoCodeStyleSettingsProvider"/>
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
/*
2+
* Copyright 2013-2015 Sergey Ignatov, Alexander Zolotov, Florin Patan
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.goide;
18+
19+
import com.intellij.facet.ui.ValidationResult;
20+
import com.intellij.openapi.module.Module;
21+
import com.intellij.openapi.progress.ProcessCanceledException;
22+
import com.intellij.openapi.project.Project;
23+
import com.intellij.openapi.vfs.VirtualFile;
24+
import com.intellij.platform.DirectoryProjectGenerator;
25+
import org.jetbrains.annotations.Nls;
26+
import org.jetbrains.annotations.NotNull;
27+
import org.jetbrains.annotations.Nullable;
28+
29+
import javax.swing.*;
30+
31+
public class GoProjectGenerator implements DirectoryProjectGenerator {
32+
@Nls
33+
@NotNull
34+
@Override
35+
public String getName() {
36+
return "Go";
37+
}
38+
39+
@Nullable
40+
@Override
41+
public Object showGenerationSettings(VirtualFile baseDir) throws ProcessCanceledException {
42+
return null;
43+
}
44+
45+
@Nullable
46+
@Override
47+
public Icon getLogo() {
48+
return GoIcons.ICON;
49+
}
50+
51+
@Override
52+
public void generateProject(@NotNull Project project, @NotNull VirtualFile baseDir, @Nullable Object settings, @NotNull Module module) {
53+
54+
}
55+
56+
@NotNull
57+
@Override
58+
public ValidationResult validate(@NotNull String baseDirPath) {
59+
return ValidationResult.OK;
60+
}
61+
}

0 commit comments

Comments
 (0)