Ensure the last line is included in projection-based visible regions#3585
Conversation
c0dc874 to
e3ed532
Compare
|
@akurtakov Would you like to review that since it seems like this also impacts lsp4e? Other than that, I think it would be good to get a review on #3456 if possible. |
f719e33 to
2767a44
Compare
|
@iloveeclipse @akurtakov Could this (and also #3456) please be reviewed? (The recent changes are just rebasing and updating copyright headers) |
|
I try to check this tomorrow. |
This change ensures that setting the visible region with projections enabled does not hide the last line in case there is additional text at the end of the line or the file is using Windows line endings.
2767a44 to
c2650ca
Compare
|
The Pull Request PR #3585 ("Ensure the last line is included in projection-based visible regions") addresses a bug where the last line of a Analysis
Conclusion Opinion: The PR is valid and the fix is implemented correctly. It addresses a real edge case in the text editor's projection/folding logic that users on Windows or with specific coding styles (trailing |
|
Thanks @danthe1st |
|
Thank you very much @danthe1st and everyone else helping him I really appreciate it. This combination of show only select element and the folding feature make Eclipse even better by having another killer unique feature which the other ides (Vscode and all his forks, Intellij and all other Jetbrains Ides) don't have. |
|
@totomomo18 You can download the last SDK/I-build at https://download.eclipse.org/eclipse/downloads/. At "Latest Downloads", select the integration build (starting with I2026) and you'll get to https://download.eclipse.org/eclipse/downloads/drops4/I20260112-1800/. Please note that this is a daily build that may contain bugs. If you find any, please report them accordingly and include the exact build you used in your report. If those bugs seem to be related to folding/visible regions, you can also add a ping so I see it (and hopefully I'm able to take a look at it) |
|
There is a new test fail coming from this PR, see #3667 |
|
I just saw that this new feature is on the official 2026 03 Eclipse version Thank you very much @danthe1st and everyone else helping him I really appreciate it. I am waiting for it to get to Eclipse Spring Sts version which I am sure is usually going to be tomorrow. I actually started to vibe code plugins for Eclipse (I love this Ide) :) and even made a great plugin for my very old Eclipse Sts (Running Java 7) and I am working on a version for the new Sts (from Java 8 onward). The plugin brings the other unique killer feature of Eclipse to the front The "Clone Editor" option. I have made a plugin which brings this option and the split options to the front. It makes Icons for it in the toolbar and in the right click context menu of the editor. I also made a new option (Which I also asked for in another issue I posted here) which was missing from the clone editor. I added an option to clone a method which mean to open the implantation of a method in a new cloned tab. The plugin works perfectly on my old Sts. I still have a few problems on the new Sts version. I may want to publish and share it to everyone but I dont know what is the proper way to do it. I am not really a plugin developer (I know nothing about the code the Ai wrote) since the Ai did all the work I just directed him till the plugin worked perfectly as far as I can see. Can I share a plugin that the Ai developed ? do plugins go trough the same unit test process before they can go to the marketplace ? |
|
@totomomo18 This should be in Spring Tools 5.1.0.
Yes, you can create an update site with your plugin (just serve it somewhere on the internet) and then add a marketplace entry at https://marketplace.eclipse.org for people to discover it. Anyway if you enjoy developing plugins-ins, maybe you also want to contribute a bugfix or some other change to the Eclipse IDE. |
|
I assumed there will be a new version of Sts coming out like 5.2.0 following the 2026 03 Eclipse release so I thought I download it from the Spring site. I have problems with my current Sts 5.1.0 . I recently check for updates on my Sts 5.1.0 and it showed me there where some update on the git plugins. I updated those change and now every time I check for updates I get no remedy error. I tried to revert the changes and it does not help. The Ai told this may caused by confict with the update sites. what are the correct update site(s) ? I would love to help you guys make changes to Eclipse. I love this Ide and I want to make it better (It already is way better than Intellij and Vscode) but I lack the knowledge. The Ai made the plugins not me I just had the ideas for improvements. I would not know where to start on changing the inner working of the actual Eclipse. |
|
Spring Tools 5.1.0 was released today and it should be based on Eclipse 2026-03 (Note that it's an external projects so this is probably not the right place for it). If you want to contribute to the Eclipse IDE, there's a starting point at https://github.com/eclipse-ide. |
|
Just wanted to give you a last update. I just finally succeeded to update my Sts 5.01 to the latest version and tested your new feature on my real code. I press show only selected element on a method and then tried the folding on a couple of big ifs and tries and it worked perfectly (With even closing } that was a problem) Thank You. |
As noticed in #3074 (comment) by @totomomo18, there are situations where the projection-based folding introduced in #3074 hides the last line where it should be shown. In that example, it was due to Windows line endings (
\r\n) where the last line was missing and it only moved past the\rbut not the\n(it didn't account for the second character).However, there is another situation where this can happen which is the case if there is additional (non-whitespace) text in the last line after the visible region. In the following example, assume that the visible region starts with
{and ends with}:Here, the
}would be hidden.An example where this could happen with JDT is enum constants (because of the
,after the constants):The problem with these situations is that projections/folding cannot hide partial lines at the end so it has to show the entire last line. When I implemented #3074, I was assuming that this was an issue with whitespace at the end but I didn't account for further text (it worked perfectly fine with comments and other things in JDT because comments at the end seem to be included in the visible regions set by JDT).
This change ensures that setting the visible region with projections enabled does not hide the last line in case there is additional text at the end of the line or the file is using Windows line endings by fixing the logic for computing the end of the visible region.