vi-eclipse / Eclipse-Platform

Umbrella repository for managing a backlog of features/issues related to the Eclipse Platform
2 stars 0 forks source link

Multi-line error message when validating regex in search #130

Open fedejeanne opened 1 month ago

fedejeanne commented 1 month ago

Problem

Some important information is lost when the error message of the regex validation of the search is done, namely the offending character.

After applying https://github.com/eclipse-platform/eclipse.platform.ui/pull/2373, the error message will look like this:

Image

...when it could look more like this:

Image

In the screenshot, you can see that the ^ is off: it should be right under the [

Goal

  1. Show the multi-line error like the one in the last screenshot but place the ^ correctly.

  2. In other multi-line error messages where the extra line does not add any value, the error message should have only 1 line.

Image

This can be easily spotted by the fact that there is no ^ in the error message.

jannisCode commented 1 month ago

it is very hard to get the position of ^ right, because the " " is smaller (les wide) than some characters. If you type a lot of i´s for example you need a different amount of spaces compared to a lot of a´s. Based on that and how often the letters of the alphabet are used on average, I found out that it is "most accurate" to always add two spaces (" " compared to " ") and for every third character only one space. This is obviously not a good solution, which is why I want to propose the following: Instead of putting the arrow in the line below, why don´t we put it in the respective line like so: image image This ensures that the arrow always points on the right character.

Until now i did not find a solution for the arrow in the line below. If there is anything i can try, i am very open to suggestions on how i could implement it.

jannisCode commented 1 month ago

I now have a solution for the initial goal with the "^" character, which is a little bit more extensive than the "<--" solution, but i believe the output is much better with this "^" . How can i get the github branch in this issue?

fedejeanne commented 1 month ago

How can i get the github branch in this issue?

You need to create an "official" issue in the official repo. This discussion (https://github.com/vi-eclipse/Eclipse-Platform/issues/130#issuecomment-2411479666) should take place there and not here in vi-eclipse :-)