Per default, Eclipse shows breakpoints in a column on the very left of a code line, together with occurrence indicators (arrows) and tag markers (clipboards). Both of these are overlapping breakpoints if they occur on the same line.
Is it possible to show preakpoints in a separate column instead? I am using the source window in the Java and Debug perspective, just in case that it looks different in other perspectives.
As you can see here, any breakpoints on the left side are obscured
nope, that cant be done -- at least up to eclipse neo. maybe u formulate a feature request or write that code urself?
workaround
breakpoints and occurrence markers are both annotations.
Annotations can be configured with regard on how and where they are displayed in preferences: general/editors/text editors/annotations
since i had the same problem, ages back, i turned off vertical ruler for the ones that get most in the way, e.g. occurrences and search results.
Related
Is there a way to just see one method of a class in the IntelliJ IDEA editor and hide everything else, and/or toggle between this and the regular view.
Please note, I'm not looking to fold/collapse other methods, which is certainly a way to minimize getting lost in a large file.
I am looking for a way to only view a specific method I'm working on within a class.
e.g. If there is a legacy code where an existing class has 10 long
methods (each ~50 lines long), and I'm working on one of them and don't wish to be lost in
the 500 lines of code and need to focus on a single method thereby narrowing my view to 50
lines of code.
I do remember a few versions back that this was possible, but am not able to find that setting now.
Further clarifying my question. Consider the method selected in the image below
I am interested in a view that'll show just the method like below (with all the java capabilities like code highlighting, refactoring etc., enabled of course):
In IntelliJ IDEA 2019.3.3 (Community Edition) there's a fold option 'Fold Selection' that hides even the signature.
Select / highlight the code above the method you want to focus on
Right click > Folding > Fold Selection. Shortcut = cmd + .
It might be in earlier versions but I haven't checked.
Fold selection menu option
When I set a break point on a row which already has a marker(The value of the local variable is not used) on it, I cannot see the break point marker; because the yellow lamp marker covers the break point marker.
Is it possible to change the priority of the markers so that the break point sits on top of the lamp marker?
As long as #Mena answer is ok, as he sais...
Use at your own risk :)
This can be dangerous in a big project.
To avoid problems with hided warnings due configurations, what I usually do is:
Leave config as is, to see warnings.
Remove all really unnecessary lines causing warnings
Add an annotation to method still having warnings but needing breakpoint at same line. You can annotate class if necessary when massive warnings or breakpoints needed.
#SuppressWarning("unused")
public void yourMethod() {
}
This will allow you to handle warnings individually and see breakpoints when necessary.
I find that incredibly annoying too.
The only solution I've found is to go to the Java editor preferences, and disable the checkbox "Report problems as you type".
This will not change the priority, it will disable the hint and only show the breakpoint.
Here's a picture to illustrate:
Use at your own risk :)
Finally a TRUE relief after years of a so annoying and tiny thing:
1) go to your eclipse install path and look for all files (filename) that contain the word "warn" and are of the format .gif or .png (because they contain transparency data), here there were 5 files whose icon/image matched, most were named as: quickfix_warning_obj.gif (or.png)
2) rename all of them to *.DISABLED like "quickfix_warning_obj.gif.DISABLED", and as soon you restart eclipse, this will force it to restore the right one as soon you open an editor that uses it and has some warning on it.
3) having detected the right file, replace it with one of identical size (width and height in pixels), I would like to suggest this image I just created, so simple and not annoying at all and still is useful!
4) restart eclipse again and clap with a smiling face!
PS.: you can try to just replace this file also, that was the right one here for Eclipse Luna:
$ECLIPSE_INSTALL_PATH/configuration/org.eclipse.osgi/478/0/.cp/icons/full/obj16/quickfix_warning_obj.gif
Obs.:
Of course you can replace all of them that look the same, change other annoying icons and so on, and experiment with your own gif/png size and image, just that these steps is what worked perfectly here.
The image I supplied is almost invisible some times, but they were never really useful to me as I let the code with warning become underlined as a highlight. A better image is welcome :)
And, of course, this is a workaround, like a theme change, that does not involve any coding/recompiling of eclipse, therefore the priority is not changed at all, but the results are good enough to me at least.
EDIT: here one for the search results: searchm_obj.gif at configuration/org.eclipse.osgi/331/0/.cp/icons/full/obj16/searchm_obj.gif on Luna
By default, pressing the Comment out shortcut keys Ctrl + /, has behavior like this:
Notice that the // get added at the left-most position of the row.
Is there a way to set it so that the // appear at the same level of indention as the code that is being commented out?
e.g.
Perhaps a Python habit, but I find it much easier to parse when everything is at the same indention level.
Is there a way to change where the slashes show up?
Yes, it's possible.
go to this link for detailed info
First go to Preferences, then
On the left side of the box, expand the Java option, then expand Code
Style and finally click Formatter
You'll land on the Java-Profile page:
The other, temporary way is via CTRL+SHIFT+F shortcut ( Eclipse: Change the block comment style of ctrl+shift+/ ) . So you'd highlight those comments, and press the combo.
I would then also use a shortcut for CTRL+SHIFT+F , like ALT+F5 (press CTRL+3 , 'keys' to get the preferences page.
I had checked out a Project from Our CVS. When I tried to build it in Eclipse by adding some jars, it showed a lot of errors under the Problems View in Eclipse.
It displayed nearly 12,000 errors, but I could see only the first 100 of those 12,000 errors.
Could anybody please explain how I can see the next 100 errors?
And I don't know why, but after I check out from CVS I am also getting these errors.
Thanks.
On Eclipse Helios click on the triangle pointing down on the Problems view, select Preferences then in the Preference dialog that appear, you can change the Limit visible items per group to change the value. Or else uncheck Use marker limits checkbox to allow all items being visible.
there is a triangle pointing down on the problems view, click on it, click configure contents, there will be "Number of items visible per groups:", change it
Just click on the arrow down in the Perspective and select Group by None.
or
Configure Contents...
In Eclipse Oxygen : Click the down triangle on the Markers panel, select Filters... , then untick the Use Limits check box in the pop up and then click OK.
Change the Fitter setting as following
The previous answers are all valid, but in Java, there is a further limit configured in the compiler preferences. This is why you may continue to see 100 items.
This article describes where to find the preference in question.
It looks like it's changed again - none of these answers seem to be valid with the current 2021-x versions.
First, find the Problems tab and look to the very right where you will find the Filters... button:
Once inside the Filters panel, look down in the bottom-left corner and either uncheck the Use limits checkbox or increase the limit from 100:
I had once a less obvious, maybe rare case where no errors and warnings were shown in the problems view. I was wondering why I don't see any entries, although I see a certain number of errors and warnings in the header of the problems view. All filters were switched off. It looked like that:
I found out that in my case the "Description" column was so small that I didn't realize, there is another column with entries that are just not visible. Resizing the column made the grouped warnings and entries visible again.
I'm trying to add a line break with the Find function in eclipse - What I want to do is put a line after each method in all my classes [I liked them all close together but now its hard to read through]. so I figure theres 2 ways to do this.
1. Find all with "public" and change to "\npublic", \n being the new line in a string to give you the idea of what I mean.
2. A convenient eclipse shortcut that separates all the methods in a class with an empty line.
Any ideas on how to achieve this? I'll be happy as long as it works and I don't have to go through every method in the project myself and push enter .-.
For #2, you can set the Eclipse auto-formatter to do so for you.
Look under the Preferences panel; in the left side (tree), select Java Code Style (click the arrow to expand the section), then Formatter. You can then decide to use a single formatting style for all of your projects, or check the box to apply a special set of formatting rules to just the current project. Some of the options include where to locate whitespace and newlines.
You can also use the “Save Actions” panel to re-apply the same formatting rules every time you save your files. Personally, I use (and team members as well) this method, to ensure that the formatting for the files is always consistent. By mechanically reformatting in this way, changes to the file will always show up “properly” in Subversion/Git — I don't accidentally have whitespace-only changes being introduced into files showing up as “false positive” changes.
Check box 'Regular Expressions' and use '\R' for Linebreak in the 'Replace with' box in eclipse
configure the auto-formatter its a bit of work for the first time but its worth, when ever you get ugly formatted code you can fix this in seconds ..