August 26, 2005

Can Eclipse do that?

Okay, I give up.  Until today, I didn't think there was any question I couldn't answer with Google (and for the problem at hand, with the Eclipse help or the various forums), but all my attempts have completely failed so far, so I'm hoping asking the question on my blog will work.

In Eclipse, Ctrl-. (control-dot) will take you to the "Next Problem".  The problem I have with this behavior is that it also stops at warnings, and most of the time, this is not what I want (I actually filter the Problems view not to display warnings, so it would make sense for Eclipse to recognize I have no desire to navigate to these warnings either).

Does anyone know a way to change the "Next Problem" to jump to problems only?  Or better:  to jump to whatever next item is listed in my Problems window, which is probably the most flexible way of providing this functionality...

If I get an answer in the comments, my next blog entry will give a few Eclipse tips.

And if I don't get any answer...  well, I'll post the tips anyway but I will be very disappointed in you all.

Update:  Eugene gave me the answer, shortly followed by Rane Prashant and then Robert.  Thanks a lot, guys, you rock!  And I learned something in the process!  Eugene, my next Eclipse tips are dedicated for you (even though you probably already know them).

 

Posted by cedric at August 26, 2005 01:02 PM
Comments

Stop writing code with so many problems and you won't need this at all! ;)

Posted by: at August 26, 2005 02:07 PM

It doesn't look like this is possible (though I can see how useful it would be!)... When in the editor, press ctrl-shift-L (this gives you a context-sensitive menu of all keyboard shortcuts available) and you'll notice that the label for CTRL-. simply reads "Next". It seems to me that if the Eclipse folks had drawn a distinction between "next error" and "next warning", this label would have expressed it.

I think you (and we) are out of luck on this one... for now.

Ooh.. I can just *feel* that look that says "I'm just so disappointed in you" now. ;-)

Posted by: Chris Beams at August 26, 2005 02:22 PM

Sounds like you don't use the warnings - you can turn them off under compiler settings. then next would only go to errors right?

Posted by: baconserker at August 26, 2005 02:31 PM

Cedric, don't listen to those previous comments. This is of course very simple to do in Eclipse. :-)

So, here is the answer. http://jroller.com/page/eu?entry=eclipse_trick_that_google_doesn

Posted by: eu at August 26, 2005 03:01 PM

Muhhhhaaaaa.

I figured it out. At least I think I did. You tell me if this works for you.

In the toolbar there are two buttons "Next Annotation" and "Previous Annotation". Notice the small dropdown arrow? Pull that thing down, uncheck errors. Now keep hitting "CTRL+.", stops only on errors. WooWhooo.

Do I get some bragging rights for helping Cedric?

Posted by: Prashant Rane at August 26, 2005 03:04 PM

I meant to say uncheck warnings in the post above. But, you get the point.

Posted by: Prashant Rane at August 26, 2005 03:05 PM

I was going to give Euxx's answer, but I think I'll give baconserker's answer... turn the warnings off.

You can turn warnings off in two ways: you can change the compiler settings, so the warnings don't appear in the first place, OR you can use the @SuppressWarnings annotation. (Mind you, if you compile outside of Eclipse, there's only a subset of warnings you can supress with this)

Personally, I turn warnings I don't care about off; I don't need the noise level. The only reason I don't make the warnings I _do_ care about errors is because I don't want to have to fix them before running tests.

Posted by: Robert Watkins at August 26, 2005 03:19 PM

With eclipse 3.1 plus Myeclipse, I didn't find the problem. I wrote a class with errors and wornings, when I pressed ctrl+. it never stopped at wornings , and when I clear the errors, it just stopped at the wornings.

Posted by: amou at August 27, 2005 07:21 AM

Thanks Cedric. I'm touched. :)

Posted by: eu at August 27, 2005 08:50 AM

The fact that something like this was not intuitive to do - let alone find and do - sums up Eclipse's usability.

Posted by: Sony Mathew at August 29, 2005 11:15 AM

Sony, it has very little todo with the usability, but just with user's learning curve and some UI defaults that could be inherited from ancient versions of Eclipse UI.

Posted by: eu at August 29, 2005 01:54 PM


don't listen to those previous comments. This is of course very simple to do in Eclipse.


eu - thanks so much. Mine was one of those previous comments, and after trying out your solution, I've realized it's one of the most useful features in Eclipse I've seen in a long time. Thanks so much... I'm glad to say I was dead wrong about this!

- Chris

Posted by: Chris Beams at September 8, 2005 10:36 PM

While I’m still looking for a solution to similar problem, I use another way:

1. Sort by line numers ascending in the Problems view by clicking on the corresponding list header.
2. Build the project: + b
3. Open the Problems view: + + q, x.
4. Go to the first problem: , .

I can’t understand why doesn’t eclipse/cdt jump to the first build problem automatically, why doesn’t it even prompt me whether to do that?

Posted by: Anatoli Sakhnik at November 12, 2008 08:08 AM
Post a comment






Remember personal info?