Permalink
Browse files

Rename and reorganize project.

Initial plugin classes are in shape and added initial lexer test framework.
  • Loading branch information...
1 parent f08421a commit c24ea7b71b06ffa388a817e7ca5b537ed69980a5 @netzpirat committed Jan 11, 2011
Showing with 1,064 additions and 330 deletions.
  1. +2 −1 .gitignore
  2. +3 −0 .gitmodules
  3. +24 −18 META-INF/plugin.xml
  4. +31 −0 README.md
  5. +107 −5 build.xml
  6. +1 −0 coffeemine.iml → coffee-brew.iml
  7. +42 −3 coffeemine.ipr → coffee-brew.ipr
  8. +269 −283 coffeemine.iws → coffee-brew.iws
  9. +1 −0 coffee-script
  10. 0 {test → resources}/coffee-script/alias.1.coffee
  11. 0 {test → resources}/coffee-script/alias.2.coffee
  12. 0 {test → resources}/coffee-script/alias.3.coffee
  13. 0 {test → resources}/coffee-script/alias.4.coffee
  14. 0 {test → resources}/coffee-script/alias.5.coffee
  15. 0 test/coffee-script/alias.7.coffee → resources/coffee-script/alias.6.coffee
  16. 0 {test → resources}/coffee-script/array.1.coffee
  17. 0 {test → resources}/coffee-script/array.2.coffee
  18. 0 {test → resources}/coffee-script/assignment.1.coffee
  19. 0 {test → resources}/coffee-script/assignment.2.coffee
  20. 0 {test → resources}/coffee-script/assignment.3.coffee
  21. 0 {test → resources}/coffee-script/assignment.4.coffee
  22. 0 {test → resources}/coffee-script/assignment.5.coffee
  23. 0 {test → resources}/coffee-script/assignment.6.coffee
  24. 0 {test → resources}/coffee-script/binding.1.coffee
  25. 0 {test → resources}/coffee-script/chained_comparisson.coffee
  26. 0 {test → resources}/coffee-script/class.1.coffee
  27. 0 {test → resources}/coffee-script/class.2.coffee
  28. +2 −0 resources/coffee-script/comment.1.coffee
  29. +4 −0 resources/coffee-script/comment.2.coffee
  30. 0 {test → resources}/coffee-script/do.1.coffee
  31. 0 {test → resources}/coffee-script/existential.1.coffee
  32. 0 {test → resources}/coffee-script/existential.2.coffee
  33. 0 {test → resources}/coffee-script/existential.3.coffee
  34. 0 {test → resources}/coffee-script/existential.4.coffee
  35. 0 {test → resources}/coffee-script/expression.1.coffee
  36. 0 {test → resources}/coffee-script/expression.2.coffee
  37. 0 {test → resources}/coffee-script/expression.3.coffee
  38. 0 {test → resources}/coffee-script/expression.4.coffee
  39. 0 {test → resources}/coffee-script/extended_regular_expression.1.coffee
  40. 0 {test → resources}/coffee-script/for.1.coffee
  41. 0 {test → resources}/coffee-script/for.2.coffee
  42. 0 {test → resources}/coffee-script/for.3.coffee
  43. 0 {test → resources}/coffee-script/function.1.coffee
  44. 0 {test → resources}/coffee-script/function.2.coffee
  45. 0 {test → resources}/coffee-script/heredoc.1.coffee
  46. 0 {test → resources}/coffee-script/heredoc.2.coffee
  47. 0 {test → resources}/coffee-script/if.1.coffee
  48. 0 {test → resources}/coffee-script/if.2.coffee
  49. 0 {test → resources}/coffee-script/if.3.coffee
  50. 0 {test → resources}/coffee-script/if.4.coffee
  51. 0 {test → resources}/coffee-script/interpolation.1.coffee
  52. 0 {test → resources}/coffee-script/interpolation.2.coffee
  53. 0 {test → resources}/coffee-script/javascript.1.coffee
  54. 0 {test → resources}/coffee-script/multiline.1.coffee
  55. 0 {test → resources}/coffee-script/object.1.coffee
  56. 0 {test → resources}/coffee-script/object.2.coffee
  57. 0 {test → resources}/coffee-script/or.coffee
  58. 0 {test → resources}/coffee-script/prototype.1.coffee
  59. 0 {test → resources}/coffee-script/quote_reserved_words.1.coffee
  60. 0 {test → resources}/coffee-script/quote_reserved_words.2.coffee
  61. 0 {test → resources}/coffee-script/range.1.coffee
  62. 0 {test → resources}/coffee-script/range.2.coffee
  63. 0 {test → resources}/coffee-script/range.3.coffee
  64. 0 {test → resources}/coffee-script/splat.1.coffee
  65. 0 {test → resources}/coffee-script/splat.2.coffee
  66. 0 {test → resources}/coffee-script/switch.1.coffee
  67. 0 {test → resources}/coffee-script/try.1.coffee
  68. 0 {test → resources}/coffee-script/while.1.coffee
  69. 0 {test → resources}/coffee-script/while.2.coffee
  70. BIN resources/org/coffeebrew/images/coffee-script.png
  71. 0 src/coffeemine/lang/coffee-script.flex
  72. +50 −0 src/org/coffeebrew/CoffeeScriptFileType.java
  73. +17 −0 src/org/coffeebrew/CoffeeScriptIcons.java
  74. +22 −0 src/org/coffeebrew/CoffeeScriptLanguage.java
  75. +34 −0 src/org/coffeebrew/CoffeeScriptLoader.java
  76. +39 −0 src/org/coffeebrew/lang/lexer/CoffeeScriptElementType.java
  77. +19 −0 src/org/coffeebrew/lang/lexer/CoffeeScriptFlexLexer.java
  78. +26 −0 src/org/coffeebrew/lang/lexer/CoffeeScriptTokenSets.java
  79. +44 −0 src/org/coffeebrew/lang/lexer/CoffeeScriptTokenTypes.java
  80. +27 −0 src/org/coffeebrew/lang/lexer/coffee-script.flex
  81. +25 −0 src/org/coffeebrew/lang/parser/CoffeeScriptParser.java
  82. +64 −0 src/org/coffeebrew/lang/parser/CoffeeScriptParserDefinition.java
  83. +31 −0 src/org/coffeebrew/lang/psi/impl/CoffeeScriptFileImpl.java
  84. +0 −1 test/coffee-script/alias.6.coffee
  85. +0 −1 test/coffee-script/array.1.tokens
  86. +0 −1 test/coffee-script/array.2.tokens
  87. +0 −1 test/coffee-script/assignment.tokens
  88. +0 −1 test/coffee-script/for.1.tokens
  89. +0 −1 test/coffee-script/for.2.tokens
  90. +0 −1 test/coffee-script/for.3.tokens
  91. +0 −1 test/coffee-script/function.1.tokens
  92. +0 −1 test/coffee-script/function.2.tokens
  93. +0 −1 test/coffee-script/if.1.tokens
  94. +0 −1 test/coffee-script/if.2.tokens
  95. +0 −1 test/coffee-script/if.3.tokens
  96. +0 −1 test/coffee-script/if.4.tokens
  97. +0 −1 test/coffee-script/object.1.tokens
  98. +0 −1 test/coffee-script/object.2.tokens
  99. +0 −1 test/coffee-script/or.tokens
  100. +0 −1 test/coffee-script/quote_reserved_words.1.tokens
  101. +0 −1 test/coffee-script/quote_reserved_words.2.tokens
  102. +0 −1 test/coffee-script/splat.1.tokens
  103. +0 −1 test/coffee-script/splat.2.tokens
  104. +18 −0 test/org/coffeebrew/lang/lexer/CoffeeScriptLexerTest.java
  105. +123 −0 test/org/coffeebrew/lang/lexer/CoffeeScriptLexerTestBase.java
  106. +39 −0 test/org/coffeebrew/lang/lexer/CoffeeScriptLexerTestToken.java
View
@@ -1,2 +1,3 @@
.DS_Store
-test/coffee-script/*.tokens
+target
+src/org/coffeebrew/lang/lexer/CoffeeScriptLexer.java
View
@@ -0,0 +1,3 @@
+[submodule "coffee-script"]
+ path = coffee-script
+ url = git://github.com/jashkenas/coffee-script.git
View
@@ -1,23 +1,29 @@
<idea-plugin version="2">
- <name>CoffeeMine</name>
- <description>CoffeeScript support for JetBrains IDEs</description>
- <version>1.0</version>
- <vendor>Michael Kessler</vendor>
- <idea-version since-build="8000"/>
+ <id>org.coffebrew</id>
+ <name>CoffeeBrew</name>
+ <description>Plugin for CoffeeScript language support</description>
+ <version>0.1.0</version>
+ <vendor logo="/org/coffeebrew/images/coffee-script.png" url="https://github.com/netzpirat/coffeebrew">Michael
+ Kessler
+ </vendor>
+ <idea-version since-build="8000"/>
- <application-components>
- <!-- Add your application components here -->
- </application-components>
+ <application-components>
+ <component>
+ <implementation-class>org.coffeebrew.CoffeeScriptLoader</implementation-class>
+ </component>
+ </application-components>
- <project-components>
- <!-- Add your project components here -->
- </project-components>
+ <project-components>
+ <!-- Add your project components here -->
+ </project-components>
- <actions>
- <!-- Add your actions here -->
- </actions>
+ <actions>
+ <!-- Add your actions here -->
+ </actions>
- <extensions defaultExtensionNs="com.intellij">
- <!-- Add your extensions here -->
- </extensions>
-</idea-plugin>
+ <extensions defaultExtensionNs="com.intellij">
+ <lang.parserDefinition language="CoffeeScript"
+ implementationClass="org.coffeebrew.lang.parser.CoffeeScriptParserDefinition"/>
+ </extensions>
+</idea-plugin>
View
@@ -0,0 +1,31 @@
+# CoffeeBrew is CoffeeScript plugin for IntelliJ IDEA
+
+CoffeeBrew is a plugin for [JetBrains](http://www.jetbrains.com) development tools. It has been successfully tested on
+the following development tools:
+
+* [IntelliJ IDEA](http://www.jetbrains.com/idea/)
+* [RubyMine](http://www.jetbrains.com/ruby/)
+
+## Features
+
+* Syntax highlighting
+* Preference pane
+* Commenting
+
+## Development
+
+CoffeeBrew is developed with [IntelliJ IDEA](http://www.jetbrains.com/idea/).
+
+* [Writing Plugins](http://www.jetbrains.org/display/IJOS/Writing+Plug-ins)
+* [IntelliJ IDEA Plugin Development](http://confluence.jetbrains.net/display/IDEADEV/PluginDevelopment)
+* [JFlex Documentation](http://jflex.de/docu.html)
+
+## License
+
+CoffeeBrew is licensed under the MIT license.
+Please see [LICENSE](http://github.com/netzpirat/coffeebrew/raw/master/LICENSE)
+
+## Acknowledgement
+
+* Jeremy Ashkenas for creating [CoffeeScript](http://jashkenas.github.com/coffee-script/)
+* David Yeung for creating [coffeescript-idea](https://github.com/yeungda/coffeescript-idea)
View
112 build.xml
@@ -1,16 +1,118 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
-<project name="coffeemine">
+<project name="coffee-brew">
- <target name="generate-tokens">
- <delete dir="test/coffee-script/*.tokens"/>
+ <!-- Define build properties -->
+
+ <property name="version" value="0.1.0"/>
+ <property name="idea.home" value="/Users/michi/Repositories/idea"/>
+
+ <!-- Reference the IDEA classpath from the local IDE installation -->
+
+ <path id="idea.classpath">
+ <fileset dir="${idea.home}">
+ <include name="lib/*.jar"/>
+ <include name="redist/*.jar"/>
+ </fileset>
+ <fileset dir="/Applications/IntelliJ IDEA 10 CE.app/lib/">
+ <include name="*.jar"/>
+ </fileset>
+ </path>
+
+ <!-- Define the java compiler task -->
+
+ <taskdef name="javac2" classname="com.intellij.ant.Javac2">
+ <classpath refid="idea.classpath"/>
+ </taskdef>
+
+ <!-- Define the jflex compiler task -->
+
+ <taskdef name="jflex" classname="JFlex.anttask.JFlexTask">
+ <classpath location="${idea.home}/tools/lexer/jflex-1.4/lib/JFlex.jar"/>
+ </taskdef>
+
+ <!-- Clean up generated files -->
+
+ <target name="clean">
+ <delete dir="target"/>
+ </target>
+
+ <!-- Create target directories -->
+
+ <target name="init">
+ <mkdir dir="target/classes"/>
+ <mkdir dir="target/test-classes"/>
+ <mkdir dir="target/junit"/>
+ <mkdir dir="target/test-reports"/>
+ <mkdir dir="target/coffee-script"/>
+ <mkdir dir="target/jar"/>
+ </target>
+
+ <!-- Copy compilation resources -->
+
+ <target name="resources" depends="init">
+ <copy todir="target/classes">
+ <fileset dir="resources/org"/>
+ <filterchain ><expandproperties/></filterchain>
+ </copy>
+ </target>
+
+ <!-- Generate the tokens from the CoffeeScript resources for testing the plugion -->
+
+ <target name="generate-tokens" depends="init">
<apply executable="/usr/local/bin/node">
<arg value="/usr/local/share/npm/bin/coffee"/>
<arg value="-t"/>
- <fileset dir="test/coffee-script" includes="*.coffee"/>
+ <fileset dir="resources/coffee-script" includes="*.coffee"/>
<redirector>
- <outputmapper type="glob" from="*.coffee" to="test/coffee-script/*.tokens"/>
+ <outputmapper type="glob" from="*.coffee" to="target/coffee-script/*.tokens"/>
</redirector>
</apply>
</target>
+ <!-- Generate the lexer class -->
+
+ <target name="generate-lexer">
+ <jflex skeleton="${idea.home}/tools/lexer/idea-flex.skeleton" nobak="true"
+ file="src/org/coffeebrew/lang/lexer/coffee-script.flex"
+ destdir="src"
+ charat="true"/>
+ </target>
+
+ <!-- Compile the plugin -->
+
+ <target name="compile" depends="resources">
+ <javac2 srcdir="src" destdir="target/classes" source="1.5" target="1.5" includeantruntime="yes">
+ <classpath refid="idea.classpath"/>
+ </javac2>
+ <javac2 srcdir="test" destdir="target/test-classes" source="1.5" target="1.5" includeantruntime="yes">
+ <classpath refid="idea.classpath"/>
+ <classpath location="target/classes"/>
+ </javac2>
+ </target>
+
+ <!-- Test the plugin -->
+
+ <target name="test" depends="compile">
+ <junit failureproperty="unit-test.fail" forkmode="once" fork="yes" includeantruntime="yes"
+ tempdir="${basedir}/target/junit" printsummary="yes" showoutput="yes">
+ <classpath location="${basedir}/target/classes"/>
+ <classpath location="${basedir}/target/test-classes"/>
+ <classpath refid="idea.classpath"/>
+ <formatter type="xml"/>
+ <batchtest todir="${basedir}/target/test-reports" fork="yes">
+ <fileset dir="${basedir}/target/test-classes" includes="**/*Test.class"/>
+ </batchtest>
+ </junit>
+ <fail if="unit-test.fail" message="unit tests failed see target/test-reports"/>
+ </target>
+
+ <!-- Build the jar -->
+
+ <target name="jar" depends="test, compile" description="Build the plugin jar">
+ <jar file="target/jar/coffee-brew-${version}.jar" compress="true">
+ <metainf includes="LICENSE"/>
+ <zipfileset dir="target/classes"/>
+ </jar>
+ </target>
+
</project>
@@ -5,6 +5,7 @@
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/test" isTestSource="true" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
@@ -11,6 +11,42 @@
<properties />
</buildFile>
</component>
+ <component name="CodeStyleSettingsManager">
+ <option name="PER_PROJECT_SETTINGS">
+ <value>
+ <ADDITIONAL_INDENT_OPTIONS fileType="groovy">
+ <option name="INDENT_SIZE" value="2" />
+ <option name="CONTINUATION_INDENT_SIZE" value="8" />
+ <option name="TAB_SIZE" value="4" />
+ <option name="USE_TAB_CHARACTER" value="false" />
+ <option name="SMART_TABS" value="false" />
+ <option name="LABEL_INDENT_SIZE" value="0" />
+ <option name="LABEL_INDENT_ABSOLUTE" value="false" />
+ <option name="USE_RELATIVE_INDENTS" value="false" />
+ </ADDITIONAL_INDENT_OPTIONS>
+ <ADDITIONAL_INDENT_OPTIONS fileType="java">
+ <option name="INDENT_SIZE" value="4" />
+ <option name="CONTINUATION_INDENT_SIZE" value="8" />
+ <option name="TAB_SIZE" value="4" />
+ <option name="USE_TAB_CHARACTER" value="false" />
+ <option name="SMART_TABS" value="false" />
+ <option name="LABEL_INDENT_SIZE" value="0" />
+ <option name="LABEL_INDENT_ABSOLUTE" value="false" />
+ <option name="USE_RELATIVE_INDENTS" value="false" />
+ </ADDITIONAL_INDENT_OPTIONS>
+ <ADDITIONAL_INDENT_OPTIONS fileType="xml">
+ <option name="INDENT_SIZE" value="4" />
+ <option name="CONTINUATION_INDENT_SIZE" value="8" />
+ <option name="TAB_SIZE" value="4" />
+ <option name="USE_TAB_CHARACTER" value="false" />
+ <option name="SMART_TABS" value="false" />
+ <option name="LABEL_INDENT_SIZE" value="0" />
+ <option name="LABEL_INDENT_ABSOLUTE" value="false" />
+ <option name="USE_RELATIVE_INDENTS" value="false" />
+ </ADDITIONAL_INDENT_OPTIONS>
+ </value>
+ </option>
+ </component>
<component name="CompilerConfiguration">
<option name="DEFAULT_COMPILER" value="Javac" />
<resourceExtensions />
@@ -35,6 +71,9 @@
<option name="SKIP_IMPORT_STATEMENTS" value="false" />
</component>
<component name="Encoding" useUTFGuessing="true" native2AsciiForPropertiesFiles="false" />
+ <component name="EntryPointsManager">
+ <entry_points version="2.0" />
+ </component>
<component name="JavadocGenerationManager">
<option name="OUTPUT_DIRECTORY" />
<option name="OPTION_SCOPE" value="protected" />
@@ -175,14 +214,14 @@
</component>
<component name="ProjectModuleManager">
<modules>
- <module fileurl="file://$PROJECT_DIR$/coffeemine.iml" filepath="$PROJECT_DIR$/coffeemine.iml" />
+ <module fileurl="file://$PROJECT_DIR$/coffee-brew.iml" filepath="$PROJECT_DIR$/coffee-brew.iml" />
</modules>
</component>
<component name="ProjectResources">
<default-html-doctype>http://www.w3.org/1999/xhtml</default-html-doctype>
</component>
- <component name="ProjectRootManager" version="2" languageLevel="JDK_1_5" assert-keyword="true" jdk-15="true" project-jdk-name="1.6" project-jdk-type="JavaSDK">
- <output url="file://$PROJECT_DIR$/out" />
+ <component name="ProjectRootManager" version="2" languageLevel="JDK_1_5" assert-keyword="true" jdk-15="true" project-jdk-name="IDEA IC-99.32" project-jdk-type="IDEA JDK">
+ <output url="file://$PROJECT_DIR$/target/classes" />
</component>
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
Oops, something went wrong.

0 comments on commit c24ea7b

Please sign in to comment.