Ruby Screenshot of the Week #22: Go To Specific Location


It's bugfixing all the way these days - I apologize for being behind on my e-mail. We're freezing 6.0 pretty soon (in eight days), so I'd really like to get some help testing the last minute fixes. More about that shortly. But first, some screenshots.



One longstanding bug we've had is that our "Go To Declaration" (holding the Ctrl or Command key down while clicking on classes or methods) would jump to a different place than you were intending. With Ruby's open classes, there are many definitions for a class, so if you want to jump to say the File class, did you want the one in ftools.rb? Or perhaps in pp.rb? We have some heuristics which pick which reference is "best" - it involves looking at things like whether each declaration has documentation, whether it's directly loaded by your file using require statements, and so on. But this can never be perfect. So, to solve this problem, Go To Declaration clicks (or Ctrl/Command-B) will now pop up a dialog when there are multiple possibilities. As before, one item is NetBeans' best guess - and it's shown first and in bold. All you have to do is press Enter or click on it to jump as before. But other matches are shown too, in a sorted order. First are the documented entries, and at the very end, :nodoc: entries (shown with
a strikethrough font effect).



Here's how this look if you for example try to jump to TestCase:






If you don't like this behavior, you can always turn it off by running NetBeans with


-J-Dgsf.im_feeling_lucky=true



This was added just this week. Something related which has been there for a while is documentation
tooltips. If you're holding the hyperlink-modifier key (Ctrl/Command) and hover over methods and
classes, it will display a tooltip with the type of the symbol and its documentation. For example,
in a Rails controller test, here's what I got:






I just (a few hours ago) checked in a bunch of changes to clean up how NetBeans handles the gem load
path. It should now finally handle $GEM_HOME properly, as well as vendor gems and in particular, vendor/rails. Thus, the active record completion I showed last week
should now work with Rails 2 and edgerails. NetBeans should properly pick gems both from the current project as well as the current gem root (based on which gem version is higher). However, all of these changes were a bit involved... So I would really appreciate if people could grab the current bits (build 4866 or later from http://deadlock.netbeans.org/hudson/job/ruby/) and take it for a quick spin. Make sure that code completion etc. picks up your gems as before. You may have to wipe out the cached indices (userdir/var/cache/) if you have any problems. Don't worry, it's always safe to wipe out stuff inside var/cache.) If there any problems, please let me know now since we're about to freeze for 6.0.



P.S. Beta 2 was released this week - download,
New And Noteworthy

Comments:

Not sure if this is the correct place for bug reports. I searched around and couldn't find another.

The "Go to File" feature does not detect recursive directory structures. I hit this problem specifically when I installed the "has_many_polymorphs" plugin.

$ ls -i vendor/plugins/has_many_polymorphs/test/integration/
32260107 app
$ ls -i vendor/plugins/has_many_polymorphs/test/integration/app/vendor/plugins/has_many_polymorphs/test/integration/
32260107 app

and so on.

PS. I'm loving Netbeans your doing an awesome job. :)

Posted by Jason Yates on October 27, 2007 at 03:17 AM PDT #

Hey Tor, I'd love to try out netbeans, but for the last couple major releases my keyboard simply doesn't work inside the editor! I'm on Ubuntu Gutsy (same happened on Fiesty) .. it comes to life occasionally when I start up the editor (sometimes not at all) but as soon as I do a 'navigate to file' I can no longer type (the file appears read only). Have you heard of anyone having this problem? Seems like a major showstopper for 6 if it's not usable on Ubuntu!

Posted by Greg Fodor on October 27, 2007 at 04:49 AM PDT #

Greg,

Make sure you are running the right version of Java as Ubuntu defaults to java-gcj.

$ sudo apt-get install sun-java6-jre

$ sudo update-alternatives --config java

or

$ bin/nbrubyide --jdkhome /usr/lib/jvm/jdk1.6.0_03/

Posted by Jason Yates on October 27, 2007 at 05:03 AM PDT #

Man, I would love to have these features for Groovy/Grails.

Good work!

Posted by Sakuraba on October 28, 2007 at 04:59 PM PDT #

Tor,

I'm currently using Eclipse DLTK but I'm quite impressed by Netbeans. I just found a very annoying missing feature.
The "toggle comment" action seems to be specific to Ruby Source code. I'd like to change the keymapping but this action is not shown in the Tools \\ Options \\ Keymap \\ Source elements. So I cannot change the associated keymap.

The problem is that

Posted by Ruby Fan on October 28, 2007 at 07:13 PM PDT #

@Greg / @Tor

Actually I have the same problem with the editor. It happens from time to time. Closing the file and reopening it helps in most cases. But it reoccurs often. Somewhat annoying. I had the same problem in several other versions of Netbeans (nightly builds, b1, b2 etc) under Feisty and Gutsy. A friend of mine had the same issue under Gentoo. We're using Gnome and Compiz if that matters. ;) And I was already using java 6.

@Tor: Small thing I noticed today: When specifying a stylesheet in a layout file that contains (SGML) comments to hide @import statements from very old browsers, then netbeans displays a syntax error, while these comments are perfectly valid in HTML (but would be real comments in XHTML). Removing the comments helps, but it's no solution of course.

Picture of Netbeans: http://www.mivesto.de/syntaxerror.png

Section of the w3c recommendation: http://www.w3.org/TR/CSS21/syndata.html#comments

Posted by graste on October 29, 2007 at 07:57 AM PDT #

Oh, and it not only happens in the editor, but in menus and dialogs as well. ATM I can't rename a file with click->rename->dialog pops up, because there is no cursor in the dialog and it's simply not successful to click into the input field. closing the dialog or clicking buttons with the mouse works flawlessly. It's weird and makes using Netbeans very annoying. But nonetheless I really really appreciate all the work you put into this and I'm working with it all the time. :)

Posted by graste on October 29, 2007 at 08:23 AM PDT #

Greg, Tor, Graste,

I thought I was the only one having that weird editor freeze on Ubuntu (sometomes you can't edit the current file anymore, you have to re-open it).

But, I think I found the solution. DROP ALL YOUR .nbi\* .netbeans\* hidden directories from your HOME directory, then re-install a recent version of the Netbeans Ruby IDE. For me the editor problem was gone this way. I'm on Ubuntu Gutsy with Java6 and it just works now.

May be one last point: I didn't try your last build, but on the older ones, I had the trouble that if an object method was missing, then Netbeans would jump to any place he could find a method definition with that name and if you don't pay attention you might eventually miss your code bug (missing method bug). I don't know if you can do something about that anyway (would guess no), not that much annoying anyway.

Hope this helps. Tor thanks for your work, Netbeans Ruby really rocks.

Posted by Raphaël Valyi on October 29, 2007 at 08:41 PM PDT #

Ruby Dark Pastels color scheme -- recent change:

Hi Tor! I want to thank you for the IDE! It is a very, very nice effort. I have switched from Textmate.

The one thing that I missed was the Black Pearl II color scheme. I was very excited when I saw the Ruby Dark Pastels scheme. I have been using that since you announced it.

However, there is a big problem with it that appeared in the past week or so. In rhtml files (or .html.erb) the color used for ruby code, the ruby-delimiter, and RUBYCOMMENT is a very light green (216,238,210). This code is TERRIBLE for this purpose. It is almost impossible to see the white text (form_for, etc.) or the green symbols (:asset).

I am having to manually change this after each build. I have been using 170,170,210 which seems to work nicely. I know this is a minor thing, but it is major if you use it daily as I do. Perhaps you could have someone look at it?

Thanks and keep up the great work!!

PS. I tried to post in the week 20 thread but the comments are closed. Also, this is a recent issue.

Posted by Mark Lane on October 30, 2007 at 06:32 AM PDT #

Shrug -- tried all the suggestions to no avail -- for me, I generally can't even edit upon starting the IDE (rarely it works.) Seems pretty severe in my case. I am running Java 6 on Gutsy and nuking my .nbi/.netbeans/.nbrubyide dirs didn't help at all.

Posted by Greg on October 30, 2007 at 07:50 AM PDT #

Hi guys,
thanks for all your comments!

Greg/graste/Raphael - uh oh, that sounds like a really critical bug. It's not one that has been reported anywhere else. Would you mind filing an issue with a lot more information? (http://wiki.netbeans.org/wiki/view/RubyFeedback)
I also have a box running Ubuntu Gutsy Gibbon + Compiz extra visual effects and I've never seen the problem (though I don't use that box very much, I'm mostly on my OSX laptop so if it's really intermittent perhaps I've just missed it). I'm using both JDK 5 and (usually) JDK 6 (1.6.0_03-b05).
The first thing to try would be to run with an alternate userdir (--userdir /tmp/test). If that works, perhaps something bad is in your userdir - move it out of the way and send it to me via the bug report (only the config/ and var/log subdirs are relevant, skip the large var/cache/ subdir). We're right about to codefreeze 6.0 - just a couple of more days for bugfixes, so hopefully we can track this down quickly!

Ruby Fan, the "Toggle Comment" action -is- available for custom keybindings. The problem is that it isn't in the "Source" category - it's in the "Other" category - along with most of the other editing actions. Yes, this is messy and something we'll definitely clean up in the next release. But you should find it there and be able to customize it.

graste - the @import syntax error parsing bug is tracked in issue 115662:
http://www.netbeans.org/issues/show_bug.cgi?id=115662

Mark - thanks for the report on the color theme. I'll look into it - I've filed issue
http://www.netbeans.org/issues/show_bug.cgi?id=120563
to track it (I can work on this after the 6.0 freeze since this is in an optional module not subject to the same deadlines).

Posted by Tor Norbye on October 30, 2007 at 08:14 AM PDT #

Hi Mark - thanks again for the report about the themes - it was trivial to fix so it should be ok in build #4925. Since you may have color edits in your userdir you may want to revert those. I removed the Ruby-area highlighting rather than set it to 170,170,210 since that's how Jerrett designed the theme.

Posted by Tor Norbye on October 30, 2007 at 08:47 AM PDT #

Just to say: you're doing great work with Netbeans, I really appreciate this IDE!
I moved from eclipse because I was lost in this IDE plugins and docs like in a big deep dark forest with a lots of trees, a lots of holes, and a lots of bugs!
Discovering netbeans and its great developpment team producing a lots of tutorials (video and text) and making effort to consider all bug reports was a real pleasure, like coming back to light. ;-)

Thanks again.

Posted by Sebastien on October 30, 2007 at 06:32 PM PDT #

Tor,

Thanks for your reply. I have been able to customize the toggle comment action.
I just discovered a very annoying issue with gem installation for me :
- I do not have a direct access to the Internet, so if I want to install something, I download it through a secured environment and afterwards I install it
- in Netbeans, gem installation seems to work only remotely.
- To workaround the remote installation, I installed manually (outside Netbeans) ruby-debug-base and ruby-debug-ide but these gems are not recognized by netbeans for debugging.

Am I missing something ?
(I'm using MRI ruby interpreter on windows).

Posted by Ruby Fan on October 30, 2007 at 06:35 PM PDT #

Restarting Netbeans solves the problem. Netbeans has taken into account ruby-debug-ide. I still have a segmentation fault (in the xml_printer.rb of ruby-debug-ide) when debugging but this seems not related with Netbeans.

Posted by Ruby Fan on October 30, 2007 at 07:06 PM PDT #

Hi all,

So I just wanted to confirm, the editor freeze didn't really went away for me as well. after several weeks without trouble it just came back. It could may be related to use use of Desktop 3D effects on Ubuntu (correlated to a certain extend to using them for me, yet not sure the correlation is total). Also disabling 3D efects without restarting Netbeans doesn't fix the problem either. Good luck on this one. Yeah, that's an annoying one for sure.

Raphaël Valyi.

Posted by Raphaël Valyi on October 30, 2007 at 07:31 PM PDT #

Very strange ! The fast debugger option has disappeared. I restarted Netbeans but this has not changed anything. But ruby-debug-base and ruby-debug-ide are actually installed. They are both seen with gem list and with the gem tool from Netbeans.

Posted by Ruby Fan on October 30, 2007 at 08:31 PM PDT #

> Ruby Fan

Yes you have to somehow trigger ruby-gems reload. One way is of course NetBeans restart. The best would be to have options to install a gem from a disk as you said. I've filed:

http://www.netbeans.org/issues/show_bug.cgi?id=120632

to be sure it will be targeted in some future release.

> I still have a segmentation fault (in the xml_printer.rb of ruby-debug-ide) when debugging but this seems not related with Netbeans.

Yes it is bug in the backend. But if you have some steps to reproduce, some script with which it always fails I would try to debug into the C code and file an issue to ruby-debug or debug-commons project. So those steps would be really appreciated.

Posted by Martin Krauskopf on October 31, 2007 at 12:13 AM PDT #

> Ruby Fan: The fast debugger option has disappeared.

Disappeared or disabled? The fast debugger option is disabled when JRuby is selected. I suppose you are using latest builds?

Might be if everything failed, could you run NetBeans with turned logging on as described here:

http://wiki.netbeans.org/wiki/view/RubyDebugging#section-RubyDebugging-HowToFileABug

and send me those logfiles. I could analyze the problem more then. Thanks for the feedback.

Posted by Martin Krauskopf on October 31, 2007 at 12:19 AM PDT #

tor - that is an awesome feature with incredible UI insight into usability. given the rapidity by which rails' underlying code changes, this was a must.

here are three other recommendations for you that would also increase usability and are becoming widely accepted standards. (1) control + mousewheel up/down to increase/decrease font. firefox, scite, and many other apps do this, and it is great for zooming in on code when someone is over your shoulder or you need to look at things differently because your window size has changed. (2) alt left/right arrow are the standard for prev/next view in a hypertext structure. surely this makes sense in an ide where we are constantly drilling in and finding our way back. using tabs to navigate should only be for those out of context browsing experiences. (3) this is big, but i wouldn't expect it to be easy. consoles, consoles, consoles. you've got an excellent code completion engine - if it were mixed with a console, might we be able to do some really cool stuff in the future with a rails console, and a "shell-like" console where we could run rails commands and basic ls/cd stuff. (in no way do i mean to discount the massive amount of work you guys do by throughing out such a huge feature.)

please keep up the wonderful work! you guys have done a wonderful job and provided a really strong case for using netbeans for ruby development over many other ides.

Posted by jherber on October 31, 2007 at 12:24 AM PDT #

Hi JHerber,
Thanks for your ideas! #2 should already work (but isn't bound to arrow left - look at the editor toolbar on the left, there are a couple of backarrow buttons there like in a browser; one for jumpto locations, one which tracks editing locations. The tooltips should show their keybindings.

#3 is definitely high on the priority list for the next release.

Raphael/Greg/Graste: I don't have any bug reports around the editor hangs you're observing. If you can generate a thread dump, that would help a lot as it would show which threads are deadlocking the IDE (or whether the problem is elsewhere) :
http://wiki.netbeans.org/wiki/view/GenerateThreadDump

I've seen that Compiz (full visual effects) and Java still have some issues with various videocards etc. so that may be causing issues. I'm not sure if there are workarounds (flags to the VM to turn change the 3dpipeline etc.) The thread dump should show whether this is the problem area or if there's something else going on.

Posted by Tor Norbye on October 31, 2007 at 12:43 AM PDT #

awesome news on #3.

a few more usability tips.

1. there is redundant information in the tabs, both an icon and an extension name. probably don't need both, and any freed up space for more tabs is appreciated.

2. in a model, when i code complete something like has_and_belongs_to_many, i get the entire formalized presentation with parenthesis and all options. great for learning (and probably a necessity in java), but bad for ruby code since often the parenthesis and optional arguments are not used. is there an easy way to accept the method/func name, but opt out on the parenthesis? i'd suggest something like 'esc' when on the first option.

thanks for replying and allowing us a chance to directly provide feedback!

Posted by jherber on October 31, 2007 at 01:21 AM PDT #

Hi Tor,

thanks for your fast answer and sorry for not responding. I didn't get an email notification in case of responses to this post.

I didn't file a bug report about this, since I don't know, if it is Netbeans related. I just checked the Compiz settings because I remembered that there is some kind of compatibility plugin. I checked it and found an activated "Workarounds" plugin with "Metacity-like workarounds". One option of this plugin is called "workarounds for java windows". Idk what it does, but I deactivated the plugin and restarted everything now. Quick test in Netbeans didn't give me any problems with the editor window, but this could be coincidence. Another problem I got was, that e.g. the "Question: Save modified file?" dialog happens to be misdisplayed the first time it shows up

gtk message in console:

(<unknown>:13359): Gtk-CRITICAL \*\*: gtk_paint_box: assertion `style->depth == gdk_drawable_get_depth (window)' failed

I will just try the editor a bit and if the problem with noneditable content appears, I will file a report with a thread dump. Perhaps the hint with that plugin helps the Netbeans team, as it seems not to be related to the Ruby functionality. Friend of mine was wondering, that I was still having the noneditable problem, as he thought it was fixed in beta2, but it turns out, that he disabled compiz a few weeks ago and so it could just be the case, that compiz is the problem here (and not Netbeans itself).

Hope that helps, because I don't feel like filing a bug report for a problem, that I can't reproduce.

Btw: before Compiz Fusion I had Beryl and had to set AWT_TOOLKIT=MToolkit as an environment variable to make Java swing applications work (they were blacked out otherwise). I don't know what the Compiz plugin does, but it could be something related.

Keep up the great work with Netbeans. If the problem is Compiz related, it would be bad (as Ubuntu and Co are widely used), but at least on production desktops in companies there will be less Compiz-running machines. ;)

@Raphaël/Greg/etc: Perhaps you could try deactivating that Compiz workaround plugin as well? I'm not using Netbeans that much ATM, that I can reproduce the editor problem often enough I guess. :)

Posted by graste on October 31, 2007 at 03:35 AM PDT #

Martin :

>Yes it is bug in the backend. But if you have some steps to reproduce, some script with which it always fails I would try to debug into the C code and file an issue to ruby-debug or debug-commons project. So those steps would be really appreciated.

Sorry, as I indicated, I was not able to launch again the fast debugger (the option has been disabled).

> Disappeared or disabled? The fast debugger option is disabled when JRuby is selected.

It has been disabled and I was using MRI.

> I suppose you are using latest builds?

Yes, you're right. Reinstalling Netbeans 6 beta 2 and deleting .nbi and .netbeans folders have solved all my issues related with the fast debugger.

Posted by Ruby Fan on October 31, 2007 at 05:19 AM PDT #

Hi all,
sorry for my wrong findings, but the editor freeze didn't go away when restarting Ubuntu without Compiz and 3D effects. So it's still arround but not very reproductible. Also, I don't have any stack trace to show up, the edition is just inactive. Not memory leak neither CPU peak... It has been arround for a lot of months actually.

Hope this helps.

Posted by Raphaël Valyi on October 31, 2007 at 08:22 AM PDT #

Hi Raphael,
when the editor freezes it's likely that there's a deadlock. In that case, follow the link above to information on how to generate a thread dump. You can send a signal to the process to get it to spit out a dump of all the thread stacks, which usually pinpoints the deadlock. (Or, if the threads are all idle we know the problem is somewhere in the gui toolkit not accepting input.)
http://wiki.netbeans.org/wiki/view/GenerateThreadDump

Posted by Tor Norbye on October 31, 2007 at 08:33 AM PDT #

Hi Tor,

I just submitted a bug report and included a thread dump. I was using Netbeans while desktop effects were disabled. So I think it really is an issue with Netbeans (instead of Compiz).

http://www.netbeans.org/issues/show_bug.cgi?id=120745

Posted by graste on October 31, 2007 at 09:40 AM PDT #

Hi Tor! A small issue: why cannot I do "run file" for just opened ruby file (without a project)? - this option is disabled

Posted by ruby.freeman on November 04, 2007 at 09:51 AM PST #

Post a Comment:
Comments are closed for this entry.
About

Tor Norbye

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today