MarkusAmshove / natls

Language Server implementation for the Natural 4GL programming language
MIT License
12 stars 3 forks source link

Disambiguate view variable access depending on adabas access context #413

Closed MarkusAmshove closed 10 months ago

MarkusAmshove commented 10 months ago

Try to disambiguate view access by looking for the current scope of adabas access.

Having this program:

DEFINE DATA LOCAL
1 A-VIEW VIEW OF A-DDM
2 DDMFIELD (A10)
1 B-VIEW VIEW OF B-DDM
2 DDMFIELD (A10)
END-DEFINE

READ A-VIEW BY ISN
    WRITE DDMFIELD /* Not ambiguous, context reveals that it has to be A-VIEW.DDMFIELD
END-READ

END

The variable resolution is now able to figure out that DDMFIELD in that context is from view A-VIEW

MarkusAmshove commented 10 months ago

@Claes65 this might be worth checking out on your side. remove 66 of 68 NPP029s for me

sonarcloud[bot] commented 10 months ago

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

92.5% 92.5% Coverage
0.0% 0.0% Duplication

Claes65 commented 10 months ago

@Claes65 this might be worth checking out on your side. remove 66 of 68 NPP029s for me

Will do 👍

Claes65 commented 10 months ago

Done These were all lines that were present in the old file but not the new file (fixed diagnostics) 244 removed (all NPP029) These were all new lines that were not present in the old file (new diagnostics) 0 added

Cool stuff, @MarkusAmshove :)