Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
NeoKaios opened this issue May 29, 2024 · 3 comments
Assignees

Comments

@NeoKaios
Copy link
Contributor

NeoKaios commented May 29, 2024

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.

@GitMensch
Copy link
Contributor

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

@NeoKaios
Copy link
Contributor Author

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

@GitMensch
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants