Skip to content

Commit

Permalink
scala added
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyasergey committed Dec 15, 2010
1 parent d291fa9 commit f871e78
Show file tree
Hide file tree
Showing 7 changed files with 106 additions and 49 deletions.
35 changes: 29 additions & 6 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<property name="project.dest" value="${project.dir}/out/production/clojure-plugin"/>
<property name="test.dest" value="${project.dir}/out/test/clojure-plugin"/>
<property name="test.dist" value="${project.dir}/test_dist"/>
<property name="main.dist" value="${project.dir}/dist"/>
<property name="idea.pack" value="${project.dir}/idea_pack"/>
<property name="tools.jar.dir" value="${java.home}/lib"/>

Expand Down Expand Up @@ -48,6 +49,9 @@
<fileset dir="${clojure.lib}">
<include name="clojure.jar"/>
</fileset>
<fileset dir="${project.lib}">
<include name="*.jar"/>
</fileset>
<fileset dir="${clojure.contrib}">
<include name="clojure-contrib.jar"/>
</fileset>
Expand Down Expand Up @@ -89,6 +93,10 @@
<delete dir="build" includes="**/*"/>
</target>

<taskdef resource="scala/tools/ant/antlib.xml">
<classpath refid="base.path"/>
</taskdef>

<target name="make.lexer">
<java jar="${project.lib}/JFlex.jar" output="jflex.log" fork="true" maxmemory="512m">
<arg value="--charat"/>
Expand All @@ -98,7 +106,18 @@
</java>
</target>

<target name="make.java" depends="make.lexer, unzip.last.successful.IDEA.build">
<target name="make.scala" depends="make.lexer, unzip.last.successful.IDEA.build">
<scalac destdir="${project.dest}"
srcdir="${project.dir}">
<classpath>
<path refid="base.path"/>
</classpath>
<include name="src/**/*.scala"/>
<include name="src/**/*.java"/>
</scalac>
</target>

<target name="make.java" depends="make.scala">
<!-- Read SINCE and UNTIL properties -->
<loadfile property="idea.build" srcFile="${idea.home}/build.txt" failonerror="true"/>
<!--Copy descriptor-->
Expand All @@ -116,7 +135,7 @@
tofile="${project.dest}/org/jetbrains/plugins/clojure/ClojureBundle.properties"/>

<taskdef name="javac2" classname="com.intellij.ant.Javac2" classpathref="idea.classpath"/>

<!--Compile project Java files-->
<javac2 srcdir="${project.dir}"
destdir="${project.dest}"
Expand Down Expand Up @@ -161,6 +180,9 @@
</jar>

<copy todir="${project.dir}/tempjar/clojure-plugin/lib">
<fileset dir="${project.lib}">
<include name="scala-library.jar"/>
</fileset>
<fileset dir="${clojure.lib}">
<include name="clojure.jar"/>
</fileset>
Expand All @@ -169,13 +191,13 @@
</fileset>
</copy>

<mkdir dir="${test.dist}"/>
<mkdir dir="${main.dist}"/>

<zip destfile="${test.dist}/clojure-intellij-bin-${plugin.version}.zip" basedir="${project.dir}/tempjar"/>
<zip destfile="${main.dist}/clojure-intellij-bin-${plugin.version}.zip" basedir="${project.dir}/tempjar"/>
<delete dir="${project.dir}/tempjar"/>

<!-- Zip sources-->
<zip destfile="${test.dist}/clojure-intellij-src-${plugin.version}.zip" basedir="${project.dir}"
<zip destfile="${main.dist}/clojure-intellij-src-${plugin.version}.zip" basedir="${project.dir}"
includes="src/**/*.java,
src/**/*.properties,
src/**/*.flex,
Expand Down Expand Up @@ -214,7 +236,8 @@
</target>

<target name="run.tests" depends="build.tests">


<mkdir dir="${test.dist}"/>
<mkdir dir="${project.dir}/logs"/>
<mkdir dir="${test.dist}/config"/>
<mkdir dir="${test.dist}/system"/>
Expand Down
17 changes: 17 additions & 0 deletions clojure-intellij-plugin.ipr
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,23 @@
<root url="file://$PROJECT_DIR$/../../enclojure/org-enclojure-repl-client/src/main/java" />
</SOURCES>
</library>
<library name="scala.sdk">
<CLASSES>
<root url="jar://$PROJECT_DIR$/lib/scala-compiler.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/scala-library.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$PROJECT_DIR$/lib/scala-library-src.jar!/" />
</SOURCES>
</library>
<library name="scalatest">
<CLASSES>
<root url="jar://$PROJECT_DIR$/lib/scalatest-1.2.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>
</project>

8 changes: 8 additions & 0 deletions clojure-plugin.iml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@
<facet type="Clojure" name="Clojure">
<configuration />
</facet>
<facet type="scala" name="Scala">
<configuration>
<option name="compilerLibraryLevel" value="Project" />
<option name="compilerLibraryName" value="scala.sdk" />
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
Expand All @@ -27,6 +33,8 @@
<SOURCES />
</library>
</orderEntry>
<orderEntry type="library" name="scala.sdk" level="project" />
<orderEntry type="library" name="scalatest" level="project" />
</component>
</module>

4 changes: 2 additions & 2 deletions src/org/jetbrains/plugins/clojure/lexer/_ClojureLexer.java

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package org.jetbrains.plugins.clojure.parameterInfo

import com.intellij.lang.parameterInfo.ParameterInfoHandlerWithTabActionSupport
import org.jetbrains.plugins.clojure.psi.api.ClList
import org.jetbrains.plugins.clojure.psi.api.symbols.ClSymbol

/**
* @author ilyas
*/

abstract class ClojureParameterInfoHandler extends ParameterInfoHandlerWithTabActionSupport[ClList, Any, ClSymbol] {

}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package org.jetbrains.plugins.clojure.psi.impl.symbols

/**
* @author ilyas
*/

import com.intellij.psi.util.PsiTreeUtil
import org.jetbrains.plugins.clojure.ClojureIcons
import org.jetbrains.plugins.clojure.psi.api.ClList
import org.jetbrains.plugins.clojure.psi.api.symbols.ClSymbol
import org.jetbrains.plugins.clojure.psi.impl.list.ListDeclarations

import javax.swing._

/**
* @author ilyas
*/

object SymbolUtils {

def getIcon(symbol: ClSymbol, flags: Int): Icon =
PsiTreeUtil.getParentOfType(symbol, classOf[ClList]) match {
case list: ClList if symbol == list.getSecondNonLeafElement() =>
list.getFirstNonLeafElement() match {
case lstSym: ClSymbol => {
lstSym.getNameString() match {
case ListDeclarations.FN => ClojureIcons.FUNCTION
case ListDeclarations.DEFN | ListDeclarations.DEFN_ => ClojureIcons.FUNCTION
case _ => null
}
}
case _ => null
}
case _ => null
}

}

0 comments on commit f871e78

Please sign in to comment.