A new integrated way to develop Lift apps with jEdit

163 views
Skip to first unread message

Stefan Ettrup

unread,
Nov 26, 2010, 2:17:03 PM11/26/10
to Lift
Hello all,

I'm currently working on a jEdit plugin named ScalaSidekick. Currently
it's a port of the Ensime application (only has a subset of the
features). However on the long term the plan is that it should be a
complete development environment for Scala developers, and that means
also for Lift development. Currenly it does only support sbt projects,
but hey who needs anything else:)
Besides that it is also possible to use sbt in the integrated console,
and a simple Scala REPL (currently without jars from the project in
classpath).

A showcase of some of the features can be seen in this screencast.
http://www.screencast.com/users/Adagioklez/folders/Jing/media/c46075bf-3486-4680-a8d3-402cc7ad8fcd
(I'm sorry for the mic)

Below follows a guide in how to set it all up:
Download jEdit 4.3.2 or newer and install it.

The plugin depend on the following plugins, make sure you have these
before install ScalaSidekick, my registered dependencies isn’t perfect
yet:)
Console: 4.4.2 or higher
ErrorList: 1.9 or higher
Project Viewer: 3.0.1 or higher
Process Shell : 1.0 or higher

Setup Scala mode in jEdit
The Scala mode I’m using is taken from the Scala distribution, but I
guess others could be used as well.
From the scala dist directory you find it under /misc/scala-tool-
support/jedit
Here there will be a directory named mode, inside is a readme on how
to install it in jEdit.

Download the following file:
https://github.com/downloads/StefanE/ScalaSidekick/ScalaSidekick-0.01.rar
This file contains five jars which all should be extracted to the
jEdit jars folder.

SBT and Error on compile
The plugin already supports error highligtning through ensime, however
if you just want to use sbt in the console this is the error settings
I use for my Error highligtning :
Plugins -> Plugin Options -> Console -> Error Patterns:
Name: Scala
Error Regexp: \[error\](\s)(\w):([\\|\w|.]*):(\d*):(\s)([\w*|(\s)|
\W]*)
Warning Regexp: \[warn\](\s)(\w):([\\|\w|.]*):(\d*):(\s)([\w*|(\s)|
\W]*)
Extra lines regexp:
Filename: $3
Linenumber: $4
Error message: $6

Three important notices:
1. Buffers should not use windows newlines “\r\n”, I’m using it with
unix “\n”, otherwise you will get some strange results when using
interactive features.
2. If you want to use SBT in console, I needed to (in windows) give
the following argument in the sbt script:
-Djline.WindowsTerminal.directConsole=false
That means that my bat is as follows:
set SCRIPT_DIR=%~dp0
java -Xmx512M -XX:MaxPermSize=512m -
Djline.WindowsTerminal.directConsole=false -jar "%SCRIPT_DIR%sbt-
launch-0.7.4.jar" %*
3. When setting up the error patterns remember to push test/commit
before pressing apply and ok, for some stupid reason it won’t save it
unless you do that first. Also sometimes it will report a dummy error
in the beginning, I’m not sure which of the other error patterns who
are creating it, but it removed all mine, and now its gone.

Feedback would be very much appreciated.

Regards Stefan Ettrup (twitter:Adagioklez)

David Bernard

unread,
Nov 26, 2010, 2:48:37 PM11/26/10
to lif...@googlegroups.com
Great stuff, I'll test it (I'm not an SBT user, but sometimes I used jEdit near eclipse ;-) )
3 years ago I created the ScalaMiniIDE for jEdit, may be the following Error patterns will help you (used to parse scalac output (or forwarded from maven)) :

Name: scalac
Error Regexp: \s*((/|\w:).+?):(\d+),?\d*:(.+)
Warning Regexp: \s*((/|\w:).+?):(\d+):\s*(?:Warning|warning|Caution|caution):\s(.+)
Extra lines regexp: \s*((?:symbol|location|found|required|missing).*)
Filename : $1
Line number :  $3
Error message : $4

Test Area:
------

/home/dwayne/work/oss/jedit/MvnPlugin/src/main/scala/net.sf.alchim.jedit.mvn/PrintStream2ConsoleOutput.scala:66: error: type mismatch;
found   : java.lang.String("[ERROR] ")
required: Int
          errorLogProcessor(txt.substring("[ERROR] "), Level.ERROR)
                                          ^
/home/dwayne/work/oss/jedit/MvnPlugin/src/main/scala/net.sf.alchim.jedit.mvn/PrintStream2ConsoleOutput.scala:66: error: type mismatch;
  found   : java.lang.String("[ERROR] ")
  required: Int
          errorLogProcessor(txt.substring("[ERROR] "), Level.ERROR)
                                          ^

/home/dwayne/work/oss/scala-tools/scala-compiler-addon/src/main/scala/org/scala_tools/compiler/doc/ModelToXML.scala:241,3: error: illegal start of simple expression

 /home/makarius/tmp/test.scala:3: warning: match is not exhaustive!
 missing combination            Nil

    xs match {
    ^
  one warning found

C:\temp\Hello.scala:2: error: not found: value pntln
      pntln("hello")
      ^
one error found

------


--
You received this message because you are subscribed to the Google Groups "Lift" group.
To post to this group, send email to lif...@googlegroups.com.
To unsubscribe from this group, send email to liftweb+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.


smu

unread,
Jan 3, 2011, 12:03:33 PM1/3/11
to Lift
Hi Stefan.

I wanted to give your plugins a try but cannot manage to get them
work. After extracting the zip into the ~/.jedit/jars folder jedit
shows me the following error:

ScalaSidekick.jar:
Cannot start: java.lang.NoSuchMethodError: scala.Predef
$.wrapRefArray([Ljava/lang/Object;)Lscala/collection/mutable/
WrappedArray;
Try updating to a newer version of the plugin.

I use all plugins you mentioned. Is there anything obvious I forgot?

Best regards,

Stefan


On 26 Nov. 2010, 20:17, Stefan Ettrup <sket....@gmail.com> wrote:
> Hello all,
>
> I'm currently working on ajEditplugin named ScalaSidekick. Currently
> it's a port of the Ensime application (only has a subset of the
> features). However on the long term the plan is that it should be a
> complete development environment for Scala developers, and that means
> also for Lift development. Currenly it does only support sbt projects,
> but hey who needs anything else:)
> Besides that it is also possible to use sbt in the integrated console,
> and a simple Scala REPL (currently without jars from the project in
> classpath).
>
> A showcase of some of the features can be seen in this screencast.http://www.screencast.com/users/Adagioklez/folders/Jing/media/c46075b...
> (I'm sorry for the mic)
>
> Below follows a guide in how to set it all up:
> DownloadjEdit4.3.2 or newer and install it.
>
> The plugin depend on the following plugins, make sure you have these
> before install ScalaSidekick, my registered dependencies isn’t perfect
> yet:)
> Console: 4.4.2 or higher
> ErrorList: 1.9 or higher
> Project Viewer:  3.0.1 or higher
> Process Shell : 1.0 or higher
>
> Setup Scala mode injEdit
> The Scala mode I’m using is taken from the Scala distribution, but I
> guess others could be used as well.
> From the scala dist directory you find it under /misc/scala-tool-
> support/jedit
> Here there will be a directory named mode, inside is a readme on how
> to install it injEdit.
>
> Download the following file:https://github.com/downloads/StefanE/ScalaSidekick/ScalaSidekick-0.01...
> This file contains five jars which all should be extracted to thejEditjars folder.

smu

unread,
Jan 4, 2011, 5:03:20 AM1/4/11
to Lift
> Hi Stefan.
>
> I wanted to give your plugins a try but cannot manage to get them
> work. After extracting the zip into the ~/.jedit/jars folder jedit
> shows me the following error:
>
> ScalaSidekick.jar:
> Cannot start: java.lang.NoSuchMethodError: scala.Predef
> $.wrapRefArray([Ljava/lang/Object;)Lscala/collection/mutable/
> WrappedArray;
> Try updating to a newer version of the plugin.

It seems I used a wrong version of Scala (2.7.7 instead of 2.8 final).
I switched to 2.8 and it starts.

Stefan Ettrup

unread,
Jan 5, 2011, 4:12:14 PM1/5/11
to Lift
Sorry for late answer... Glad too see you did find a solution to the
problem. If anything else arises again, you can just send me an email.

Regards Stefan

Jean-François St-Germain

unread,
Feb 21, 2011, 2:52:42 PM2/21/11
to lif...@googlegroups.com
Getting the same problem here, updating the scala-library.jar and scala-compiler.jar didn't fix the issue...

Reply all
Reply to author
Forward
0 new messages