superbol-studio-oss icon indicating copy to clipboard operation
superbol-studio-oss copied to clipboard

`Lsp_lookup.element_at_position` unable to find 88 level fields in the Data division

Open NeoKaios opened this issue 1 year ago • 3 comments

When hovering or going to definition on a condition field (88), the lsp lookup the element under the cursor with the Lsp_lookup.element_at_position function, which in turn uses the fold_unit_group Visitor. When checking the position of a 88 field, the function returns nothing.

This is because the Lsp_position.sieve skips elements whose loc doesn't include the requested position. But the loc of the item_definition which contains the 88 field stops after the last sub-fields, not after the last condition field. Like so:

+       5           WORKING-STORAGE SECTION.
+       6 >         01 VAL PIC X.
+    ----           ^^^^^^^^^^^^^
+       7             88 COND VALUE "A".

Once this is fixed, it will possible to hover and go to def on such position.

NeoKaios avatar May 29 '24 11:05 NeoKaios

I'm a bit confused now - was this fixed by the referenced PR?

GitMensch avatar Jun 10 '24 07:06 GitMensch

No it was not, atm when hovering or [go to definition] on the example given, the lsp fails to find the definition

NeoKaios avatar Jun 11 '24 10:06 NeoKaios

@nberth any ETA here? [I just make a mental list for a possible switch from bitlang.cobol]

GitMensch avatar Aug 13 '24 11:08 GitMensch