[ANN] Ruby Editor Plugin for jEdit 0.6 - method completion release

R

Rob .

Version 0.6 of jEdit's Ruby Editor Plugin has been released and is
available for download!

For details and downloads go to:

http://www.jedit.org/ruby/

0.6 introduces two major new features that will make you more
productive when you write Ruby code, particularly if you are new to Ruby:

- Method completion for the Ruby core types via a popup that appears
when you type '.' after a variable name. This feature uses the methods
you have already called on a variable to guess it's type, and the
popup is populated accordingly.

- An integrated Ruby documentation viewer (that's modelled after
FreeRide's documentation plugin). While selecting a method via the
completion popup you can see the corresponding method documentation on
the docked documentation viewer.

Have fun! As always, feedback and suggestions are welcome.

Special thanks to all the free software programmers whose work is
being leveraged to create the plugin, particularly those in the JRuby
team for their excellent Ruby parser, and Slava Pestov for jEdit
itself.

The Ruby Editor Plugin and jEdit are released as free software with
full source code, provided under the terms of the GNU General Public
License.

Cheers,
Rob
 
A

Alexandru Popescu

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

#: Rob . said :: 5/5/2005 4:04 AM :#
Version 0.6 of jEdit's Ruby Editor Plugin has been released and is
available for download!

For details and downloads go to:

http://www.jedit.org/ruby/

0.6 introduces two major new features that will make you more
productive when you write Ruby code, particularly if you are new to Ruby:

- Method completion for the Ruby core types via a popup that appears
when you type '.' after a variable name. This feature uses the methods
you have already called on a variable to guess it's type, and the
popup is populated accordingly.

- An integrated Ruby documentation viewer (that's modelled after
FreeRide's documentation plugin). While selecting a method via the
completion popup you can see the corresponding method documentation on
the docked documentation viewer.

Have fun! As always, feedback and suggestions are welcome.

Special thanks to all the free software programmers whose work is
being leveraged to create the plugin, particularly those in the JRuby
team for their excellent Ruby parser, and Slava Pestov for jEdit
itself.

The Ruby Editor Plugin and jEdit are released as free software with
full source code, provided under the terms of the GNU General Public
License.

Cheers,
Rob

Great job Rob!

Is there a ml for the plugin?

:alex |.::the_mindstorm::.|
- --
<<<<<<<<<<<<<<<<<<<--->>>>>>>>>>>>>>>>>>>
#:there are no problems, only solutions:#
<<<<<<<<<<<<<<<<<<<--->>>>>>>>>>>>>>>>>>>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (MingW32)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFCedW2OCPjdDT2FEURArlkAJ4stX6aeQH+j+lblSSatofhY83qZQCgvQpI
Fcd12hkvpEU/LrVAa1HMTp0=
=v4eT
-----END PGP SIGNATURE-----
 
R

Rob .

Alexandru Popescu wrote:> Rob . said:> > Version 0.6 of jEdit's Ruby Editor Plugin has been released and is> > available for download!> >> > http://www.jedit.org/ruby/> > Great job Rob!Mulþumesc!
Is there a ml for the plugin?There's no mailing list yet. Feedback via ruby-talk or direct to me isok for now. If it gets high volume I'll start a ml.
Rob
 
A

Alexandru Popescu

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

#: Tom Copeland said :: 5/5/2005 3:12 PM :#
Da, foarte buna!

Tom

Another romanian speaking ruby-guy?

To Rob:
"a_string_here". => produces an exception


:alex |.::the_mindstorm::.|
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (MingW32)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFCejh0OCPjdDT2FEURAvQNAJ0S8vpQ/KJSOFhCA3iCMGRj+j9vaQCgkRwZ
4g1aR/gFrN1p+ycX9TN1Mgo=
=/vT2
-----END PGP SIGNATURE-----
 
R

Rob .

Alex, I don't get an exception in this case, but I see what you mean.
The plugin can easily determine the type of the following and provide
the appropriate method popup list. It should be an easy fix. Are there
any others I'm missing apart from these:

irb> {}.class
=> Hash

irb> "".class
=> String

irb> ''.class
=> String

irb> [].class
=> Array

Rob
 
B

Belorion

I am also getting an exception ...

jEdit 4.3pre2, WinXP

a = []
a << 1
a.(error now[1])

So far, I *alwas* get this error no matter what I am attempting to complete.

Matt

1. >> Error Msg <<
Error in method invocation: Static method completeMethod(
org.gjt.sp.jedit.View ) not found in class'org.jedit.ruby.RubyActions'
: at Line: 4 : in file: inline evaluation of:
``__internal_action_ruby_complete_method(ns) {
this.callstack.set(0,ns); org.j . . . '' : org .jedit .ruby
RubyActions .completeMethod ( view )

at bsh.BSHMethodInvocation.eval(BSHMethodInvocation.java:76)
at bsh.BSHPrimaryExpression.eval(BSHPrimaryExpression.java:102)
at bsh.BSHPrimaryExpression.eval(BSHPrimaryExpression.java:47)
at bsh.BSHBlock.evalBlock(BSHBlock.java:130)
at bsh.BSHBlock.eval(BSHBlock.java:80)
at bsh.BshMethod.invokeImpl(BshMethod.java:349)
at bsh.BshMethod.invoke(BshMethod.java:246)
at bsh.BshMethod.invoke(BshMethod.java:171)
at org.gjt.sp.jedit.BeanShell.runCachedBlock(BeanShell.java:507)
at org.gjt.sp.jedit.BeanShellAction.invoke(BeanShellAction.java:76)
at org.gjt.sp.jedit.gui.InputHandler.invokeAction(InputHandler.java:229)
at org.gjt.sp.jedit.gui.InputHandler.invokeAction(InputHandler.java:195)
at org.gjt.sp.jedit.gui.DefaultInputHandler.handleKey(DefaultInputHandler.java:356)
at org.gjt.sp.jedit.View.processKeyEvent(View.java:678)
at org.gjt.sp.jedit.textarea.JEditTextArea.processKeyEvent(JEditTextArea.java:4748)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.KeyboardFocusManager.redispatchEvent(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.dispatchEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
 
B

Brian Schröder

Alex, I don't get an exception in this case, but I see what you mean.
The plugin can easily determine the type of the following and provide
the appropriate method popup list. It should be an easy fix. Are there
any others I'm missing apart from these:

irb> {}.class
=> Hash

irb> "".class
=> String

irb> ''.class
=> String

irb> [].class
=> Array

irb(main):001:0> %().class
=> String
irb(main):002:0> %//.class
=> String
irb(main):003:0> %{}.class
=> String
irb(main):004:0> %|and many more|.class
=> String
irb(main):005:0> %r().class
=> Regexp
irb(main):006:0> %r|and many more|.class
=> Regexp

and the whole % family ;)

regards,

Brian
 
A

Alexandru Popescu

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I have a strange idea - not sure if it worth anything :-S.
It is something like "fuzzy/hippie autocompletion proposal":

1/ if i can determine the type of the variable than the autocompletion proposal should be strict (it
should contain only its methods)

2/ if i cannot determine the type of the variable i always display the super Object methods and than
by scanning backword and foreword propose a set of fuzzy/hippie autocompletion

makes any sense?

:alex |.::the_mindstorm::.|
- --
<<<<<<<<<<<<<<<<<<<--->>>>>>>>>>>>>>>>>>>
#:there are no problems, only solutions:#
<<<<<<<<<<<<<<<<<<<--->>>>>>>>>>>>>>>>>>>

#: Rob . said :: 5/5/2005 4:35 PM :#
Alex, I don't get an exception in this case, but I see what you mean.
The plugin can easily determine the type of the following and provide
the appropriate method popup list. It should be an easy fix. Are there
any others I'm missing apart from these:

irb> {}.class
=> Hash

irb> "".class
=> String

irb> ''.class
=> String

irb> [].class
=> Array

Rob

Alexandru said:
To Rob:
"a_string_here". => produces an exception

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (MingW32)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFCej7yOCPjdDT2FEURAh/kAJ47r6JzhoTWLIt3DX57gE46CYx8/QCglql0
AvCAUW1jLoMPq+feUhPVxQM=
=4zAv
-----END PGP SIGNATURE-----
 
J

Jaypee

Belorion a écrit :
I am also getting an exception ...

jEdit 4.3pre2, WinXP

a = []
a << 1
a.(error now[1])

So far, I *alwas* get this error no matter what I am attempting to complete.

Matt

1. >> Error Msg <<
Error in method invocation: Static method completeMethod(
org.gjt.sp.jedit.View ) not found in class'org.jedit.ruby.RubyActions'
: at Line: 4 : in file: inline evaluation of:
``__internal_action_ruby_complete_method(ns) {
this.callstack.set(0,ns); org.j . . . '' : org .jedit .ruby
RubyActions .completeMethod ( view )

at bsh.BSHMethodInvocation.eval(BSHMethodInvocation.java:76)
at bsh.BSHPrimaryExpression.eval(BSHPrimaryExpression.java:102)
at bsh.BSHPrimaryExpression.eval(BSHPrimaryExpression.java:47)
at bsh.BSHBlock.evalBlock(BSHBlock.java:130)
at bsh.BSHBlock.eval(BSHBlock.java:80)
at bsh.BshMethod.invokeImpl(BshMethod.java:349)
at bsh.BshMethod.invoke(BshMethod.java:246)
at bsh.BshMethod.invoke(BshMethod.java:171)
at org.gjt.sp.jedit.BeanShell.runCachedBlock(BeanShell.java:507)
at org.gjt.sp.jedit.BeanShellAction.invoke(BeanShellAction.java:76)
at org.gjt.sp.jedit.gui.InputHandler.invokeAction(InputHandler.java:229)
at org.gjt.sp.jedit.gui.InputHandler.invokeAction(InputHandler.java:195)
at org.gjt.sp.jedit.gui.DefaultInputHandler.handleKey(DefaultInputHandler.java:356)
at org.gjt.sp.jedit.View.processKeyEvent(View.java:678)
at org.gjt.sp.jedit.textarea.JEditTextArea.processKeyEvent(JEditTextArea.java:4748)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.KeyboardFocusManager.redispatchEvent(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.dispatchEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Me too, same exception on Mac OS X 10.4 (Tiger release)
J-P
 
R

Rob .

Thanks for the exception report. Not sure what's going wrong. I'm not
seeing this exception with:
jEdit 4.2final, WinXP
RubyPlugin 0.6
SideKick 0.3.3
ProjectViewer 2.1.0.1

Do you have the same plugin versions as me? What happens if you try
using jEdit 4.2final instead of 4.3pre2?

Rob
 
B

Belorion

First of all ... let me apologize for not giving you all the details.
I get the aforementioned error, *but*, I also seem to get the method
drop box anyway 90% of the time.

I just installed 4.2final (though I did not remove 4.3pre2, just
installed 4.2f in a different directory). Same problem. I get the
error, but I also get the drop box anyway.

Matt

p.s. I have failed to mention so far that this 0.6 release is great!
I love the improved doc lookup, and although I get an error for method
completion, it does after all complete my methods! ;)
 
R

Rob .

Found the problem. By mistake I left in an unnecessary hook for a
"complete method" action. Please don't bind a shortcut key to the
"complete method" action.

Instead on the Plugins->Plugins Options dialog, configure the SideKick
plugin to "Show completion popups where possible", ie make sure that
checkbox is checked. Then the complete popup will appear automatically
when you type a '.' after a variable.

Thanks for bringing my attention to this bug. I'll put out a new
release tonight. No more 3am releases for me! :)

Cheers,
Rob
 
F

Florian Groß

Rob said:
Are there any others I'm missing apart from these:

irb> {}.class
=> Hash

irb> "".class
=> String

irb> ''.class
=> String

irb> [].class
=> Array

I have not tried out this release, but regarding literals, there is also
at least these:

//.class (also all the %r() ones)
1.class (also other bases like 0x42, 0b1101, 0777 etc.)
1.0.class (complete with 10.5e32 etc.)
:foo.class (also :"foo#{1+1}" etc.)
experimental lambda literals in 1.9 (you can probably ignore them)
true, false, nil

There is also built-in classes / modules of whom you will know all class
methods, but that might be too complex for now.

Oh, and great work on all this. Weren't it for jEdit I would still be
working on my Rails project with notepad and the Windows Explorer.
 
I

Ilias Lazaridis

Rob said:
Version 0.6 of jEdit's Ruby Editor Plugin has been released and is
available for download!

For details and downloads go to:

http://www.jedit.org/ruby/

0.6 introduces two major new features that will make you more
productive when you write Ruby code, particularly if you are new to Ruby:

- Method completion for the Ruby core types via a popup that appears
when you type '.' after a variable name. This feature uses the methods
you have already called on a variable to guess it's type, and the
popup is populated accordingly.

- An integrated Ruby documentation viewer (that's modelled after
FreeRide's documentation plugin). While selecting a method via the
completion popup you can see the corresponding method documentation on
the docked documentation viewer.

Have fun! As always, feedback and suggestions are welcome.

I would prefere i pure ruby IDE [because the nature of Ruby requires an
native IDE for efficient development].

like e.g.:

http://freeride.rubyforge.org/wiki/wiki.pl

-

I understand the multilangue requirement, which is covered by jedit.

And possibly there are peole that have not the code-size reuquirement
(like me), thus they can use java stuff.

But wouldn't then eclipse (www.eclipse.org) be the more natural choice?

quasi-industry-standard, very liberal license.
 
L

Lothar Scholz

Hello Ilias,

IL> I would prefere i pure ruby IDE [because the nature of Ruby requires an
IL> native IDE for efficient development].

If you mean scriptable in ruby then i could maybe agree with you. But
otherwise the IDE core technology does not matter. In fact i have the
same argument as with the ruby in ruby interpreter: Speed, memory and
non ability for threading are the main show stoppers for this at the
moment. And FreeRide is not a native Ruby IDE, its just glue code
around a few components that are mostly written in C/C++: Ripper,
Scintilla, FOX.
 
K

Karl von Laudermann

Rob said:
Alex, I don't get an exception in this case, but I see what you mean.
The plugin can easily determine the type of the following and provide
the appropriate method popup list. It should be an easy fix. Are there
any others I'm missing apart from these:

irb> {}.class
=> Hash

irb> "".class
=> String

irb> ''.class
=> String

irb> [].class
=> Array

Well, there's this:
irb> //.class
=> Regexp

Not to mention all of the % forms:

irb> %().class
=> String

irb> %q().class
=> String

irb> %q!!.class
=> String

irb> %Q**.class
=> String

irb> %q .class # Yes, space is a valid delimiter!
=> String

irb> %r##.class
=> Regexp

Including word arrays:

irb> %w<>.class
=> Array

See, this is why the ruby.xml file got so huge in version 0.4, when I
added support for all of these constructs. BTW, I'm not going to insist
that you add support for this one:

irb> %x(echo hello).class
=> String

:)
Though, I don't know if it's possible for a system command to return
anything other than a string.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,902
Latest member
Elena68X5

Latest Threads

Top