Various errors with clojuredev 0.0.6 -- continued from Clojure list

13 views
Skip to first unread message

T. Ettinger

unread,
Jan 18, 2009, 10:58:51 PM1/18/09
to clojuredev-users
I am continuing this thread from the Clojure mailing list, where it
probably wasn't suitable. So, I forgot to attach the main error that
was not part of the log:
"Could not open the editor: The editor class could not be
instantiated. This usually indicates a missing no-arg constructor or
that the editor's class name was mistyped in plugin.xml." I installed
clojuredev 0.0.6 by the update site using my Macbook running Mac OS
10.5 (Leopard); my main JVM is J2SE-1.5 though I have JavaSE-1.6
available as well.

EDIT: I wrote that previous section before I tried an update of
Clojuredev via the Software Updates menu. That brought it up to
version 0.0.9, but to update Eclipse I had to restart. On startup,
there was the error "The Eclipse executable launcher was unable to
locate its companion shared library." A quick Google search let me
solve this; something along the lines of a change in eclipse.ini that
a quick edit recovered. After this, the Clojure Project wizard was
nowhere to be seen, and editing a .clj file would only use the plain
text editor. So, I uninstalled 0.0.9 and installed 0.0.6 through the
update site. As is to be expected, I am having he same issue as a
while back: "The selected wizard could not be started.
Plug-in clojuredev was unable to load class
clojuredev.wizards.NewClojureProjectWizard.
An error occurred while automatically activating bundle clojuredev
(658)."
This is pretty frustrating, but I'm not giving up just yet. Any
suggestions?

Laurent PETIT

unread,
Jan 19, 2009, 1:28:03 AM1/19/09
to clojured...@googlegroups.com
Hello,

This is really weird.

I personally reinstalled 0.0.9 on my environment (but I'm on Windows) and it did so correctly.

I'll try to install 0.0.9 at work, from a freshly installed/unzipped version : I'm under Linux at work, so this will be an interesting test.

e , do you have time to try version 0.0.9 ?

Thanks in advance,

--
Laurent

2009/1/19, T. Ettinger <tommy.e...@gmail.com>:

Laurent PETIT

unread,
Jan 19, 2009, 7:12:52 AM1/19/09
to clojured...@googlegroups.com
I succesfully installed clojure-dev in a freshly installed eclipse (3.4 java developer version) under Linux Ubuntu.
So it worked on Windows & on Linux ...

I wonder what the problem could be with imac ... ?

When I have time today, I'll move the update site to the wiki section. Maybe there's sometimes network problem with subversion access (I've always found it *veeeerrrry slow* on googlecode), and eclipse doesn't report the error correctly ...

To check that both plugins (clojure & clojure-dev) are correctly installed, you can go to Help > About > Plugins > [sort by plugin id column to find both 'clojure' & 'clojuredev' plugins]

Cheers,

--
Laurent


2009/1/19 Laurent PETIT <lauren...@gmail.com>

T. Ettinger

unread,
Jan 19, 2009, 5:19:34 PM1/19/09
to clojuredev-users
I checked About Plugins, and it lists the clojure plugin as 0.0.1.1
and the clojuredev plugin as 0.0.6 . I wasn't aware that the clojure
plugin existed, or that its version number was so low; is this
normal? I am not sure if Eclipse is looking at clojure.jar , which
contains the Clojure language, or some Eclipse plugin I wasn't aware
of. Problems with mac could be based on paths; /Library/Java/
Extensions holds clojure.jar , but some applications have had trouble
accessing it because of some ownership issue I fixed (this was when I
was compiling 0.0.7 ). The issue was that clojure.jar was listed
twice in the Java classpath... OH MY GOD. That's it! On Mac, you are
supposed to place clojure.jar in /Library/Java/Extensions , but
because eclipse puts clojure-0.0.1.1 in /Applications/eclipse/
plugins , Eclipse looks for the locked one in the first directory
before it finds the one in the plugin directory, thus preventing
Clojure code from being executed in Eclipse. I moved clojure.jar out
of Extensions and out of the classpath, and it works like a charm. I
will experiment a little now to see if I can raise the clojure plugin
version. Thanks for your time, and I will try to stay with this
project and help out when I can. Any hope of getting a rainbow-paren
style of behavior like the one used with the clojure mode for emacs?
Maybe I could try to write that?
This is just awesome.

On Jan 19, 4:12 am, "Laurent PETIT" <laurent.pe...@gmail.com> wrote:
> I succesfully installed clojure-dev in a freshly installed eclipse (3.4 java
> developer version) under Linux Ubuntu.
> So it worked on Windows & on Linux ...
>
> I wonder what the problem could be with imac ... ?
>
> When I have time today, I'll move the update site to the wiki section. Maybe
> there's sometimes network problem with subversion access (I've always found
> it *veeeerrrry slow* on googlecode), and eclipse doesn't report the error
> correctly ...
>
> To check that both plugins (clojure & clojure-dev) are correctly installed,
> you can go to Help > About > Plugins > [sort by plugin id column to find
> both 'clojure' & 'clojuredev' plugins]
>
> Cheers,
>
> --
> Laurent
>
> 2009/1/19 Laurent PETIT <laurent.pe...@gmail.com>
>
> > Hello,
>
> > This is really weird.
>
> > I personally reinstalled 0.0.9 on my environment (but I'm on Windows) and
> > it did so correctly.
>
> > I'll try to install 0.0.9 at work, from a freshly installed/unzipped
> > version : I'm under Linux at work, so this will be an interesting test.
>
> > e , do you have time to try version 0.0.9 ?
>
> > Thanks in advance,
>
> > --
> > Laurent
>
> > 2009/1/19, T. Ettinger <tommy.ettin...@gmail.com>:

Laurent PETIT

unread,
Jan 19, 2009, 5:32:56 PM1/19/09
to clojured...@googlegroups.com
That's great you found the problem ! I would'nt have found it myself, even with a couple more weeks on the subject ! :-)

I think you should now be able to upgrade to the last version from the update site. Then you'll be able to experiment with the namespace browser (I'm pretty happy with what it can already do).

For your information, I'm currently on the road to implement "go to source definition" to be called via double click on a symbol of the namespace browser (and this code will also be the base for future inter-files "jump to .." functionalities).

Concerning the rainbow stuff, could you point me/us to an example (a link ?) of what it is exactly ?
Or can you explain more ?

Thanks,

--
Laurent

2009/1/19, T. Ettinger <tommy.e...@gmail.com>:

T. Ettinger

unread,
Jan 19, 2009, 8:16:43 PM1/19/09
to clojuredev-users
I just uploaded a screenshot that has the Rainbow Paren script (or
plugin or something -- I don't recall the term) running in a VIM GUI,
MacVim (not emacs, I was mistaken). It automatically colors
parentheses so that each matching pair (up to 10 deep) is a different
color from other pairs near it. I found that it made reading Clojure
code easier when I was using VIM (I gave up on VIM and headed for
Eclipse because the REPL connector, Gorilla, was not usable for me,
and because I am a lot more familiar with Eclipse). I think I could
implement it if I get the hang of Eclipse plug-in development. The
original Rainbow Parens page is at http://www.vim.org/scripts/script.php?script_id=1230
.

On Jan 19, 2:32 pm, "Laurent PETIT" <laurent.pe...@gmail.com> wrote:
> That's great you found the problem ! I would'nt have found it myself, even
> with a couple more weeks on the subject ! :-)
>
> I think you should now be able to upgrade to the last version from the
> update site. Then you'll be able to experiment with the namespace browser
> (I'm pretty happy with what it can already do).
>
> For your information, I'm currently on the road to implement "go to source
> definition" to be called via double click on a symbol of the namespace
> browser (and this code will also be the base for future inter-files "jump to
> .." functionalities).
>
> Concerning the rainbow stuff, could you point me/us to an example (a link ?)
> of what it is exactly ?
> Or can you explain more ?
>
> Thanks,
>
> --
> Laurent
>
> 2009/1/19, T. Ettinger <tommy.ettin...@gmail.com>:

Laurent PETIT

unread,
Jan 20, 2009, 6:17:42 AM1/20/09
to clojured...@googlegroups.com
Hello,

I'll look at it when time permits.

For your information, the syntax coloring, while still not sexy yet, is done on the basis of a lexical analysis made via a custom antlr grammar. So I think it is very easy to add Rainbow Paren script because we can control the data that are emitted by the lexer, and very easily add the current nesting level of the opening or closing paren (It's just a matter or a few embedded java code in the antlr lexer grammar).

Can you describe the algorithm in plain english ? (e.g. is it a color per nesting level, or rotating colors whenever it encounters a new opening paren, or does it also look ahead to take into account the color of the closing parens ... ?)

CONCERNING the status of the namespace browser, I managed to make it open an editor on the file of the symbol that is double click, if the file is in the current project. I've struggled with how to do this for files that are embedded in jars, or not in the current project. I finally found that I should use EFS (Eclipse File System), but had no time yet to try it. Nothing has been checked in svn for now, though.

Cheers,

--
Laurent

2009/1/20 T. Ettinger <tommy.e...@gmail.com>

Laurent PETIT

unread,
Jan 20, 2009, 12:50:10 PM1/20/09
to clojured...@googlegroups.com
Well,

I took 30 minutes to think about paren rainbow, and I finally got it done within this time frame !

I just commited the file, so if you are able to start the plugin from source code, you can take a look at it.

It seems to have revealed an underlying bug in the current lexer, that's a first good point ! :-)

Try to open it on clojure.core/core.clj !

I have to polish it a little bit, and we have to choose the colors more carefully. For the moment, I've used the provided system colors to not have to manage them (they are global at Display level and need not be disposed of).

Sorry Thomas, I know you wanted to do it, but it really was evident once I had the code under my eyes, I could'nt resist.

--
Laurent



2009/1/20 Laurent PETIT <lauren...@gmail.com>

T. Ettinger

unread,
Jan 20, 2009, 8:14:29 PM1/20/09
to clojuredev-users
Trying to get some parenthetical coloration happening, I compiled from
source around 4:00 Pacific Time. More accurately, I checked out
revision 125 from SVN around then. However, after I went online to
figure out what files to look at to see the code, I found out that at
4:33, rainbow paren had updated, and 9 minutes later the update site
was updated as well. So, I installed from the update site and it
works just fine. The only issue I can think of is the use of the same
color of blue for "double-quoted strings" and parentheses at the
second level. That is more than a little confusing, and I may start
looking around to see where colors are assigned. (I recommend a
middle-tone greenish-blue, 0x009999, instead of what it looks like is
0x0000FF at the moment.) Other than that, the paren-rainbow helps
quite a bit to distinguish where one function ends and another begins,
so it works almost as it should. I am amazed how fast you got it
working -- was it really that simple, or are you that experienced with
Eclipse? :-)

On Jan 20, 9:50 am, "Laurent PETIT" <laurent.pe...@gmail.com> wrote:
> Well,
>
> I took 30 minutes to think about paren rainbow, and I finally got it done
> within this time frame !
>
> I just commited the file, so if you are able to start the plugin from source
> code, you can take a look at it.
>
> It seems to have revealed an underlying bug in the current lexer, that's a
> first good point ! :-)
>
> Try to open it on clojure.core/core.clj !
>
> I have to polish it a little bit, and we have to choose the colors more
> carefully. For the moment, I've used the provided system colors to not have
> to manage them (they are global at Display level and need not be disposed
> of).
>
> Sorry Thomas, I know you wanted to do it, but it really was evident once I
> had the code under my eyes, I could'nt resist.
>
> --
> Laurent
>
> 2009/1/20 Laurent PETIT <laurent.pe...@gmail.com>
>
> > Hello,
>
> > I'll look at it when time permits.
>
> > For your information, the syntax coloring, while still not sexy yet, is
> > done on the basis of a lexical analysis made via a custom antlr grammar. So
> > I think it is very easy to add Rainbow Paren script because we can control
> > the data that are emitted by the lexer, and very easily add the current
> > nesting level of the opening or closing paren (It's just a matter or a few
> > embedded java code in the antlr lexer grammar).
>
> > Can you describe the algorithm in plain english ? (e.g. is it a color per
> > nesting level, or rotating colors whenever it encounters a new opening
> > paren, or does it also look ahead to take into account the color of the
> > closing parens ... ?)
>
> > CONCERNING the status of the namespace browser, I managed to make it open
> > an editor on the file of the symbol that is double click, if the file is in
> > the current project. I've struggled with how to do this for files that are
> > embedded in jars, or not in the current project. I finally found that I
> > should use EFS (Eclipse File System), but had no time yet to try it. Nothing
> > has been checked in svn for now, though.
>
> > Cheers,
>
> > --
> > Laurent
>
> > 2009/1/20 T. Ettinger <tommy.ettin...@gmail.com>

Laurent PETIT

unread,
Jan 21, 2009, 1:47:47 AM1/21/09
to clojured...@googlegroups.com
Hello,

2009/1/21 T. Ettinger <tommy.e...@gmail.com>

Trying to get some parenthetical coloration happening, I compiled from
source around 4:00 Pacific Time.  More accurately, I checked out
revision 125 from SVN around then.  However, after I went online to
figure out what files to look at to see the code, I found out that at
4:33, rainbow paren had updated, and 9 minutes later the update site
was updated as well.  

Well, I should refrain myself coding, or I won't be able to be there in the long run.
Yesterday I went to bed at 2 a.m., local hour (the first version of paren coloring revealed a more general bug in the syntax coloring algorithm, and I have continued until I have tried a way to get it (and so paren coloring) right.
 
Please note that, as a proof of concept, I have also enabled a different coloring of closing paren that do not match any opening paren.

So, I installed from the update site and it
works just fine.  The only issue I can think of is the use of the same
color of blue for "double-quoted strings" and parentheses at the
second level.

Ah OK.
For the moment, I have aligned as much as possible the colors of the clojure editor with the currently active colors set for the java editor. So normally this blue for Strings should be the same for both editors. And if the user changes color for Strings in the java editor, they should also change (for new opened editors I think) on clojure editors.

 That is more than a little confusing, and I may start
looking around to see where colors are assigned.  (I recommend a
middle-tone greenish-blue, 0x009999, instead of what it looks like is
0x0000FF at the moment.)

Are you suggesting another color for the second paren level, or for Strings ?
Anyway, if we want custom colors, it gets (just a little bit) more complicated because then we won't just use system allocated colors. We will have to use plugin allocated colors, and manage the colors disposal ourselves. So we need a new parameter to be passed to the AntlrClojureParser, or to create a new global ColorManager at ClojuredevPlugin level.
 
Other than that, the paren-rainbow helps
quite a bit to distinguish where one function ends and another begins,
so it works almost as it should.  I am amazed how fast you got it
working -- was it really that simple, or are you that experienced with
Eclipse? :-)

A mix of both ;-)

No, it was not really hard, given the mechanisms I had already in place for syntax coloring. As simple as sniffing each token whose text was "(" or ")" to count the paren nesting level, and change the color from the classical to the color defined for that level (in a rotating fashion so that you can go any deeper you want in the nesting).

--
Laurent

T. Ettinger

unread,
Jan 21, 2009, 3:09:31 PM1/21/09
to clojuredev-users
You know what? I wasn't satisfied with someone else doing all the
work. :-) If you want to change some of the more challenging colors,
add the following to ClojuredevPlugin's static variables in
clojuredev.ClojuredevPlugin.java : [code]
public static Color[] allColors = new Color[] {
new Color(Display.getDefault(), 0x00, 0xCC, 0x00),
new Color(Display.getDefault(), 0x00, 0x88, 0xAA),
new Color(Display.getDefault(), 0x66, 0x00, 0xAA),
new Color(Display.getDefault(), 0x00, 0x77, 0x00),
new Color(Display.getDefault(), 0x77, 0xEE, 0x00),
new Color(Display.getDefault(), 0xFF, 0x88, 0x00)
};
[/code]
And to the beginning of the body of stop() in the same file : [code]
for(Color c : allColors)
{
c.dispose();
}
[/code]
Then change the array initializer for the variable parenLevelTokens in
the file
clojuredev.utils.editors.antlrbased.AntlrBasedTokenScanner.java to
read as follows : [code]
private IToken[] parenLevelTokens = new IToken[] {
new org.eclipse.jface.text.rules.Token(new TextAttribute
(Display.getDefault().getSystemColor(SWT.COLOR_RED))),
new org.eclipse.jface.text.rules.Token(new TextAttribute
(ClojuredevPlugin.allColors[0])),
new org.eclipse.jface.text.rules.Token(new TextAttribute
(Display.getDefault().getSystemColor(SWT.COLOR_GRAY))),
new org.eclipse.jface.text.rules.Token(new TextAttribute
(Display.getDefault().getSystemColor(SWT.COLOR_MAGENTA))),
new org.eclipse.jface.text.rules.Token(new TextAttribute
(ClojuredevPlugin.allColors[1])),

new org.eclipse.jface.text.rules.Token(new TextAttribute
(ClojuredevPlugin.allColors[2])),
new org.eclipse.jface.text.rules.Token(new TextAttribute
(ClojuredevPlugin.allColors[3])),
new org.eclipse.jface.text.rules.Token(new TextAttribute
(Display.getDefault().getSystemColor(SWT.COLOR_DARK_GRAY))),
new org.eclipse.jface.text.rules.Token(new TextAttribute
(ClojuredevPlugin.allColors[4])),
new org.eclipse.jface.text.rules.Token(new TextAttribute
(Display.getDefault().getSystemColor(SWT.COLOR_DARK_BLUE))),

new org.eclipse.jface.text.rules.Token(new TextAttribute
(ClojuredevPlugin.allColors[5])),
new org.eclipse.jface.text.rules.Token(new TextAttribute
(Display.getDefault().getSystemColor(SWT.COLOR_DARK_CYAN)))
};
[/code]
That should change Rainbow-Paren to work as more of a rainbow and less
of a "dark grayish streak." Plus, the non-system colors are taken
care of by dispose() called when the plugin calls stop() . It isn't
perfect, but it seems to work -- not sure about memory, but that
should do the trick. I have next to no experience with patches, so
sorry this post is so shoddy.
On Jan 20, 10:47 pm, Laurent PETIT <laurent.pe...@gmail.com> wrote:
> Hello,
>
> 2009/1/21 T. Ettinger <tommy.ettin...@gmail.com>
> ...
>
> read more »

Laurent PETIT

unread,
Jan 21, 2009, 5:59:49 PM1/21/09
to clojured...@googlegroups.com
Thomas, those are really better color choices, thanks !

I commited revision 128 with your changes, and some code refactoring.

Update site updated with version 0.0.11

I also made changes on the screenshots pages to show Paren Rainbow in action : http://code.google.com/p/clojure-dev/wiki/ScreenShots

Thanks again for the patch,


Regards,

--
Laurent

2009/1/21 T. Ettinger <tommy.e...@gmail.com>
Reply all
Reply to author
Forward
0 new messages