OCamlPro / superbol-studio-oss

Open-Source part of SuperBOL Studio, including the Visual Studio Code extension and its LSP server
https://superbol.eu
Other
24 stars 13 forks source link

Improve the information shown when hovering data fields of `-EDITED` category #296

Closed NeoKaios closed 3 months ago

NeoKaios commented 5 months ago

Some variable with Edited picture string, such as:

01 VAR PIC -BZZZ,ZZ9.99.

Display really long text on hover, in this case:

...
NUMERIC-EDITED(digits = 8, scale = 2, with_sign = false, editions = { Data_picture.TYPES.basics = [(Data_picture.TYPES.FixedInsertion { Data_picture.TYPES.fixed_insertion_symbol = -; fixed_insertion_offset = 0 }); (Data_picture.TYPES.SimpleInsertion { Data_picture.TYPES.simple_insertion_symbols = { Data_picture.TYPES.symbol = B; symbol_occurences = 1 }; simple_insertion_offset = 1 }); (Data_picture.TYPES.SimpleInsertion { Data_picture.TYPES.simple_insertion_symbols = { Data_picture.TYPES.symbol = grouping separator; symbol_occurences = 1 }; simple_insertion_offset = 5 }); (Data_picture.TYPES.SpecialInsertion { Data_picture.TYPES.special_insertion_offset = 9; special_insertion_length = 1 })]; floating = None; zerorepl = (Some { Data_picture.TYPES.zero_replacement_symbol = Z; zero_replacement_ranges = [{ Data_picture.TYPES.floating_range_offset = 2; floating_range_length = 3 }; { Data_picture.TYPES.floating_range_offset = 6; floating_range_length = 2 }] }) })

This could be improved by the following:

One could show edition informations in more or less useful ways. Not in general at first (i.e, putting special insertion and zero replacement aside), a series of _s, some being replaced with fixed or simple insertion symbols, and only in the case where we have the length of the data, could be nice. Like - ___,___.__ in the case above (we have the offsets). Not sure that would be helpful, but that may be worth a try. The next step would be to show examples with "typical" data (like - 123,456.12 for instance). https://github.com/OCamlPro/superbol-studio-oss/pull/293#discussion_r1618433421

GitMensch commented 5 months ago

Why not just displaying the picture clause on hover?

nberth commented 5 months ago

Why not just displaying the picture clause on hover?

Our goal is ultimately to show summarized information/documentation: people that are not familiar with all the arcanes of the picture string language may prefer this over the picture string itself. In the short term, though, it seems showing picture strings themselves, especially when they are relevant (i.e adding more information than just "numeric of 2 digits"), could be done rather easily (@NeoKaios).