Bug 426377 - code folding with "null record" in Ada folds the rest of the file completely
Summary: code folding with "null record" in Ada folds the rest of the file completely
Status: RESOLVED FIXED
Alias: None
Product: frameworks-syntax-highlighting
Classification: Frameworks and Libraries
Component: syntax (other bugs)
Version First Reported In: unspecified
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-09-10 15:48 UTC by Mario Blunk
Modified: 2023-07-14 21:31 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
wrong folded "null record" (4.51 KB, image/png)
2020-09-10 15:49 UTC, Mario Blunk
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mario Blunk 2020-09-10 15:48:23 UTC
SUMMARY
Code folding on "null record" does not work properly.

OBSERVED RESULT
If code is folded at a line like

type thing is null record;

then everything after that line down to the end of the file is folded.

EXPECTED RESULT
A fold should not be allowed instead.

SOFTWARE/OS VERSIONS
Linux/Xfce: 4.14
KDE Plasma Version: none
KDE Frameworks Version: none
Qt Version: 5.15.0

ADDITIONAL INFORMATION
Comment 1 Mario Blunk 2020-09-10 15:49:10 UTC
Created attachment 131545 [details]
wrong folded "null record"
Comment 2 Justin Zobel 2020-11-13 05:51:06 UTC
Can you please supply the relevant code for testing purposes?
Comment 3 Mario Blunk 2020-11-13 21:00:42 UTC
(In reply to Justin Zobel from comment #2)
> Can you please supply the relevant code for testing purposes?

Hi Justin,
thanks for your work. Please find some examples on null-records here:
https://github.com/Blunk-electronic/ada_training/blob/master/src/records_3/records_3.adb

Best,
Mario
Comment 4 Justin Zobel 2020-11-13 21:49:35 UTC
Information supplied, moving back to reported status for investigation.
Comment 5 Justin Zobel 2020-11-14 00:05:22 UTC
Thanks Mario, I can confirm this folds from null record; to the end of the file.
Comment 6 Bug Janitor Service 2023-07-13 00:28:43 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/syntax-highlighting/-/merge_requests/503
Comment 7 Christoph Cullmann 2023-07-14 21:31:49 UTC
Git commit a22703c25934b7d1ff30e6b1dde47d94d1e2e19e by Christoph Cullmann, on behalf of Jonathan Poelen.
Committed on 14/07/2023 at 21:31.
Pushed by cullmann into branch 'master'.

ADA: fix folding on "null record" ; add digit separator, based numeral and keywords

- fix folding on `null record`

```ada
type Car is record -- beginRegion=RecordRegion
  -- .....
end record -- endRegion=RecordRegion
type Null_Record is null record;
-- Before                ~~~~~~ beginRegion=RecordRegion
-- After                 ~~~~~~ no region
```

- new highlight: Base, Exponent

```ada
   3#011201#e3
-- ^ Base
--   ^ Decimal
--         ^ Base
--          ^ Exponent

   3#0112401#e3
-- ^ Base
--   ^ Decimal
--       ^ Normal Text (4 is not valid in base 3)
```

A  +164  -0    autotests/folding/test.adb.fold
A  +171  -0    autotests/html/test.adb.dark.html
A  +171  -0    autotests/html/test.adb.html
A  +164  -0    autotests/input/test.adb
A  +164  -0    autotests/reference/test.adb.ref
M  +167  -24   data/syntax/ada.xml

https://invent.kde.org/frameworks/syntax-highlighting/-/commit/a22703c25934b7d1ff30e6b1dde47d94d1e2e19e