Eclipse 2021-12: Hidden code sections - Looking collapsed without any way to expand - eclipse

In my Java files I have frequently issues like the following example:
Eclipse is hiding lines and there is no way to expand them.
My first assumption was that the line endings might be inconsistent (mixed Unix/Windows line endings), so I changed them to Windows line endings with Notepad++, but this did not solve the problem.
How could I fix this problem?

Related

How can I make Visual Studio Code suggest tab-completions for any previous line in the file?

I want visual studio code to suggest an autocompletion for an entire line if I start typing the first few characters of any line already in the file, regardless of the content of the existing line. So if this is the content of my file:
this is a line with whitespace
this,is,a,comma,separated,list
And I type this on a new line, I would get a pop-up like any other autocomplete suggestion and I could fill in either of the lines above. How can I do this (and if I can't, is there another editor that has this ability)?
The extension Line Completion does what you want.
You have to configure for which files (language identifiers) it should perform these suggestions. (To prevent to much calculation on large files where you don't use it. See the README page.

Line wrapping TeX from Visual Studio Code

I'm seeking a command that when I highlight a paragraph of text in Visual Studio Code will let me remove all line breaks, and correspondingly a command that if I highlight a paragraph without line breaks will insert them at the end of the display width.
It wont be enough to just use Alt-Z because that just makes the display show the line wrapping but doesn't actually insert the line breaks.
For context: I'm using a VS Code latex plugin which is a compiled text editor format. Errors in this system trace back to line numbers so if you don't have line breaks you have to hunt down the error somewhere in a large paragraph. But of course this being a text document there you often have to edit paragraphs and end-of-lines become jagged and hard to read/update.
You can set this behavior searching for "Word Wrap" in the settings. Set to "on" to wrap the words.
Found a solution, maybe it will help someone in the future.: install "rewrap" extension. Select portion of text, and use Alt-q. Seems to work like Emacs' M-q command. (Thx Grant)

Comparing files in eclipse show same whitespaces as different

Why does the compare files in Eclipse show difference between an identical line that starts and/or stops with white spaces?
Why would anyone ever want this "feature" anyway, all lines become marked as different. Must be a bug.
I know I can use the ignore white spaces setting, but then it ignores the differens in block indentation as well and I don't want that.
Forgot to answer this one.
It was an extra carriage return on one side (PC newline, and the other had Mac/*nix), that would make it ignore the "ignore whitespace" setting for those lines.

Why are these line heights varied?

Note the attached screenshot from my Emacs 24. It is in Fundamental mode, no visual line mode is turned on, and I don't think I've turned on any word wrap mode either:
You can clearly see that the lines at the bottom are closer together than the lines at the top, but I have no idea why.. it's all just text? Why is emacs doing that?
This is the mode I am in:
Update: It just occured to me that perhaps this issue is that I am copying/pasting this text into emacs as I take notes from a PDF I am reading. Perhaps emacs is somehow getting formatting based from this copy/paste? I thought this was a text-only file with no formatting, but perhaps that is not true?
The issue is due to unusual quote symbols, both apostrophes and quotation marks, that are affecting the line heights. Removing these and using "normal" quote marks resolves the issue.

How to remove empty line from the end of new class - Eclipse

I currently work on Eclipse Juno 4.2 (but problem is connected with older versions of eclipse as well) and I found an irritating issue. When we try to create new class with a default formatter settings, eclipse put an empty line at the end of file.
I tried to figure out by myself how to remove this annoying line and search in formatter options. I found option that could help solve my problem but i found it's disable by default.
My question is: How to get rid of this line?
It's not really an empty line. It just appears that way in Eclipse.
When you see the blank line in Eclipse, it means that the last line of the file is terminated by a new line character. That is, the last characters in your Java file are probably }\n (on *nix, with LF line endings) or }\r\n (CRLF line endings on Windows), followed in each case by the end of the file.
You can prove this to yourself using tail or cat on *nix. If the prompt appears on the same line as the last line of code, then there's no trailing new line. If the prompt appears on a separate line, then there is a trailing new line character. If there's a blank line before the prompt, then there's an empty line in the file.
If the above doesn't convince you, use a hex editor. :o) An empty line would appear as two consecutive line endings: \n\n or \r\n\r\n (on *nix and windows respectively).
There's nothing wrong with the last line of your file having a new line character at the end. In fact, it's a good idea to leave it there, because some tools will warn if it's not there. These tools include Checkstyle (there's an Eclipse Checkstyle plugin) and diff.
Eclipse allows you to put the cursor there in case you want to add new content to the end of the file. (This isn't often needed in Java, because most people don't put more than one top-level type in a file.)
Best just to leave it there, and get used to Eclipse showing it.