Permalink
Browse files

Initial commit. A script editor (working for *.sc files) has rudiment…

…ary syntax highlighting.
  • Loading branch information...
1 parent 1b49e95 commit 5e09be93675c4954defe6a3579946bcbe0512c2b @dragos dragos committed Jul 20, 2012
Showing with 949 additions and 3 deletions.
  1. +2 −0 .gitignore
  2. +28 −3 README.md
  3. +17 −0 org.scalaide.worksheet.feature/.project
  4. +1 −0 org.scalaide.worksheet.feature/build.properties
  5. +81 −0 org.scalaide.worksheet.feature/feature.xml
  6. +12 −0 org.scalaide.worksheet.feature/pom.xml
  7. +17 −0 org.scalaide.worksheet.source.feature/.project
  8. +2 −0 org.scalaide.worksheet.source.feature/build.properties
  9. +65 −0 org.scalaide.worksheet.source.feature/feature.xml
  10. +11 −0 org.scalaide.worksheet.source.feature/pom.xml
  11. +8 −0 org.scalaide.worksheet.tests/.classpath
  12. +18 −0 org.scalaide.worksheet.tests/.project
  13. +16 −0 org.scalaide.worksheet.tests/META-INF/MANIFEST.MF
  14. +5 −0 org.scalaide.worksheet.tests/build.properties
  15. +25 −0 org.scalaide.worksheet.tests/pom.xml
  16. +17 −0 org.scalaide.worksheet.tests/src/org/scalaide/worksheet/SomeInterestingCodeTest.scala
  17. +1 −0 org.scalaide.worksheet.tests/test-workspace/.gitignore
  18. +7 −0 org.scalaide.worksheet.tests/test-workspace/aProject/.classpath
  19. +18 −0 org.scalaide.worksheet.tests/test-workspace/aProject/.project
  20. +9 −0 org.scalaide.worksheet.tests/test-workspace/aProject/src/org/example/ScalaClass.scala
  21. +17 −0 org.scalaide.worksheet.update-site/.project
  22. +12 −0 org.scalaide.worksheet.update-site/pom.xml
  23. +11 −0 org.scalaide.worksheet.update-site/site.xml
  24. +8 −0 org.scalaide.worksheet/.classpath
  25. +26 −0 org.scalaide.worksheet/.project
  26. +33 −0 org.scalaide.worksheet/META-INF/MANIFEST.MF
  27. +6 −0 org.scalaide.worksheet/build.properties
  28. BIN org.scalaide.worksheet/icons/sample.gif
  29. 0 org.scalaide.worksheet/plugin.properties
  30. +15 −0 org.scalaide.worksheet/plugin.xml
  31. +13 −0 org.scalaide.worksheet/pom.xml
  32. +96 −0 org.scalaide.worksheet/src/org/scalaide/worksheet/editors/ScriptConfiguration.scala
  33. +27 −0 org.scalaide.worksheet/src/org/scalaide/worksheet/editors/ScriptDocumentProvider.scala
  34. +25 −0 org.scalaide.worksheet/src/org/scalaide/worksheet/editors/ScriptEditor.scala
  35. +300 −0 pom.xml
View
@@ -0,0 +1,2 @@
+target/
+.cache
View
@@ -1,4 +1,29 @@
-scala-worksheet
-===============
+scala-ide-plugin.g8
+===================
-A Scala IDE plugin for a multi-line REPL (called worksheet)
+Giger8 template for Eclipse plugins based on the Scala IDE.
+
+This template produces 5 Eclipse plugins:
+
+* the plugin itself
+* the `plugin.tests` fragment
+* an Eclipse feature
+* an Eclipse source feature
+* an Eclipse update-site
+
+The projects can readily be imported inside Eclipse. Additionally, you have maven `pom` files
+based on Tycho, enabling command line builds.
+
+## Note:
+
+There is no default profile. You need to specify a profile manually, choosing what version
+of the Scala IDE and Scala compiler you want to build against:
+
+* `scala-ide-2.0-scala-2.9`
+* `scala-ide-2.0.x-scala-2.9`
+* `scala-ide-master-scala-2.9`
+* `scala-ide-master-scala-trunk`
+
+Run maven like this:
+
+ mvn -P scala-ide-master-scala-trunk clean install
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.scalaide.worksheet.feature</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.pde.FeatureBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.FeatureNature</nature>
+ </natures>
+</projectDescription>
@@ -0,0 +1 @@
+bin.includes = feature.xml
@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<feature
+ id="org.scalaide.worksheet.feature"
+ label=""
+ version="0.1.0.qualifier"
+ provider-name="org.scalaide"
+ plugin="org.scalaide.worksheet">
+
+ <description url="http://example.org">
+ Template of a Scala IDE plug-in
+ </description>
+
+ <copyright url="http://example.org/downloads/">
+ Copyright (C) 2012 _______TO_UPDATE_______.
+All rights reserved.
+ </copyright>
+
+ <license url="http://scala-lang.org/downloads/license.html">
+ SCALA LICENSE
+
+Copyright (C) 2011-2012 Artima, Inc. All rights reserved.
+
+This software was developed by _______TO_UPDATE_______.
+
+Permission to use, copy, modify, and distribute this software in source
+or binary form for any purpose with or without fee is hereby granted,
+provided that the following conditions are met:
+
+ 1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ 3. Neither the name of the EPFL nor the names of its contributors
+ may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+
+THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS&apos;&apos; AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
+ </license>
+
+ <url>
+ <update label="Scala IDE plugin template update site" url="http://example.org/update/site"/>
+ </url>
+
+ <requires>
+ <import plugin="org.eclipse.core.runtime"/>
+ <import plugin="org.eclipse.jface.text"/>
+ <import plugin="org.eclipse.ui"/>
+ <import plugin="org.eclipse.ui.ide"/>
+ <import plugin="org.eclipse.ui.editors"/>
+ <import plugin="org.eclipse.ui.console"/>
+ <import plugin="org.eclipse.jdt.core"/>
+ <import plugin="org.eclipse.jdt.ui"/>
+ <import plugin="org.eclipse.jdt.launching"/>
+ <import plugin="org.eclipse.debug.ui"/>
+ <import plugin="org.eclipse.jdt.debug.ui"/>
+ <import plugin="org.eclipse.ui.forms"/>
+ <import plugin="org.scala-ide.sdt.core"/>
+ </requires>
+
+ <plugin
+ id="org.scalaide.worksheet"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+</feature>
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.scalaide</groupId>
+ <artifactId>org.scalaide.worksheet.build</artifactId>
+ <version>0.1.0-SNAPSHOT</version>
+ </parent>
+ <artifactId>org.scalaide.worksheet.feature</artifactId>
+ <packaging>eclipse-feature</packaging>
+</project>
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.scalaide.worksheet.source.feature</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.pde.FeatureBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.FeatureNature</nature>
+ </natures>
+</projectDescription>
@@ -0,0 +1,2 @@
+bin.includes = \
+feature.xml
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<feature
+ id="org.scalaide.worksheet.source.feature"
+ label="Scala IDE plugin template sources"
+ version="0.1.0.qualifier"
+ provider-name="example.org">
+
+ <description url="http://example.org/">
+ The source of ScalaTest plugin for Scala IDE to provides a platform to run
+ tests written using ScalaTest or other test frameworks.
+ </description>
+
+ <copyright url="http://example.org/downloads/">
+ Copyright (C) 2011-2012 ______TO_UPDATE_______.
+All rights reserved.
+ </copyright>
+
+ <license url="http://scala-lang.org/downloads/license.html">
+SCALA LICENSE
+
+Copyright (C) 2011-2012 Artima, Inc. All rights reserved.
+
+This software was developed by ______TO_UPDATE_______.
+
+Permission to use, copy, modify, and distribute this software in source
+or binary form for any purpose with or without fee is hereby granted,
+provided that the following conditions are met:
+
+ 1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ 3. Neither the name of the EPFL nor the names of its contributors
+ may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+
+THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS&apos;&apos; AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
+ </license>
+
+ <url>
+ <update label="Scala IDE plugin template update site" url="http://example.org/update/site"/>
+ </url>
+
+ <plugin
+ id="org.scalaide.worksheet.source"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+</feature>
@@ -0,0 +1,11 @@
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.scalaide</groupId>
+ <artifactId>org.scalaide.worksheet.build</artifactId>
+ <version>0.1.0-SNAPSHOT</version>
+ </parent>
+ <artifactId>org.scalaide.worksheet.source.feature</artifactId>
+ <packaging>eclipse-feature</packaging>
+</project>
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.scala-ide.sdt.launching.SCALA_CONTAINER"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.scalaide.worksheet.tests</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.scala-ide.sdt.core.scalabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.scala-ide.sdt.core.scalanature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
@@ -0,0 +1,16 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Scala Plugin (Test)
+Bundle-SymbolicName: org.scalaide.worksheet.tests
+Bundle-Version: 0.1.0.qualifier
+Bundle-Vendor: scala-ide.org
+Fragment-Host: org.scalaide.worksheet
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Require-Bundle: org.scala-ide.scala.library,
+ org.eclipse.equinox.weaving.aspectj,
+ org.junit4;bundle-version="4.5.0",
+ org.scala-ide.sdt.core
+Import-Package: scala.tools.eclipse.testsetup,
+ org.aspectj.weaver.loadtime.definition
+Bundle-ClassPath: .,
+ target/lib/mockito-all-1.9.0.jar
@@ -0,0 +1,5 @@
+source.. = src/
+output.. = target/classes/
+bin.includes = META-INF/,\
+ test-workspace/,\
+ .
@@ -0,0 +1,25 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemalocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.scalaide</groupId>
+ <artifactId>org.scalaide.worksheet.build</artifactId>
+ <version>0.1.0-SNAPSHOT</version>
+ </parent>
+ <artifactId>org.scalaide.worksheet.tests</artifactId>
+ <packaging>eclipse-test-plugin</packaging>
+
+ <build>
+ <sourceDirectory>src</sourceDirectory>
+ <plugins>
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>tycho-surefire-plugin</artifactId>
+ <configuration>
+ <testSuite>${project.artifactId}</testSuite>
+ <testClass>org.scalaide.worksheet.SomeInterestingCodeTest</testClass>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
+
@@ -0,0 +1,17 @@
+package org.scalaide.worksheet
+
+import org.junit.Test
+import org.junit.Assert._
+import scala.tools.eclipse.testsetup.TestProjectSetup
+
+class SomeInterestingCodeTest extends TestProjectSetup("aProject", bundleName= "org.scalaide.worksheet") {
+
+ @Test
+ def numberOfTypes() {
+ val compilationUnit= scalaCompilationUnit("org/example/ScalaClass.scala")
+
+ assertEquals("Wrong number of types", 2, SomeInterestingCode.numberOfTypes(compilationUnit))
+
+ }
+
+}
@@ -0,0 +1 @@
+bin/
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.scala-ide.sdt.launching.SCALA_CONTAINER"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>aProject</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.scala-ide.sdt.core.scalabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.scala-ide.sdt.core.scalanature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
@@ -0,0 +1,9 @@
+package org.example
+
+class ScalaClass {
+
+}
+
+object ScalaClass {
+
+}
Oops, something went wrong.

0 comments on commit 5e09be9

Please sign in to comment.