Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions idea-plugin/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@

out
gen
JFlex.jar
courier-idea-plugin.jar
*.jar
idea-flex.skeleton
idea-flex_2.skeleton
src/org/coursera/courier/CourierLexer.java
4 changes: 2 additions & 2 deletions idea-plugin/META-INF/plugin.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<idea-plugin version="2">
<idea-plugin>
<id>org.coursera.courier.plugin</id>
<name>Courier schema language</name>
<version>1.6.0</version>
<version>1.6.1</version>
<vendor url="https://groups.google.com/forum/#!forum/courier">Courier OSS Project</vendor>

<description><![CDATA[
Expand Down
14 changes: 14 additions & 0 deletions idea-plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,20 @@ Features:
* Doc comment support
* Optimize imports

Hacker's Setup
--------------

1. Import the `idea-plugin` directory using IntelliJ IDEA. Key ideas:
* You need need the IntelliJ IDEA SDK (not a Java SDK), and
* You need to **use the current idea-plugin.iml**
2. Go to each .bnf file using the project explorer, right-click, and "Generate Parser Code"
* src/org/coursera/courier/Courier.bnf
* src/org/coursera/courier/schemadoc/schemadoc.bnf
3. Go to the main .flex using the project explorer, right-click, and "Run JFlex Generator"
* src/org/coursera/courier/psi/Courier.flex
4. Build the project.
5. Test it by doing "Run > Run 'Courier Plugin' ".

Making changes to the Schema language
-------------------------------------

Expand Down
14 changes: 14 additions & 0 deletions idea-plugin/idea-plugin.iml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="PLUGIN_MODULE" version="4">
<component name="DevKit.ModuleBuildProperties" url="file://$MODULE_DIR$/META-INF/plugin.xml" />
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/gen" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/resources" type="java-resource" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
Binary file removed idea-plugin/idea-plugin.jar
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ protected final CourierTopLevel doCreate(
}
}

@NotNull
public static String getNamespace(@NotNull PsiDirectory directory) {
PsiPackage ns = JavaDirectoryService.getInstance().getPackage(directory);
return ns != null ? ns.getQualifiedName() : "UNKNOWN";
Expand Down Expand Up @@ -157,11 +158,5 @@ protected void postProcess(CourierTopLevel createdElement, String templateName,
}
}

private static ArrayFactory<CourierTopLevel> ARRAY_FACTORY = new ArrayFactory<CourierTopLevel>() {
@NotNull
@Override
public CourierTopLevel[] create(int count) {
return new CourierTopLevel[count];
}
};
private static ArrayFactory<CourierTopLevel> ARRAY_FACTORY = count -> new CourierTopLevel[count];
}
3 changes: 0 additions & 3 deletions idea-plugin/src/org/coursera/courier/psi/TypeName.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
package org.coursera.courier.psi;

import com.google.common.base.Strings;
import com.intellij.openapi.util.text.StringUtil;

import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
Expand Down