metaborg / nabl

Spoofax' Name Binding Language
Apache License 2.0
7 stars 12 forks source link

Rule origin tracking #117

Open AZWN opened 8 months ago

AZWN commented 8 months ago

Short description To aid debugging, it would be valuable to see the original (file) location of a rule/constraint in the debugger.

Problem description. When having a Rule object at runtime, it is not easy to track from which file it originated. The prefix of the rule name is the file of the predicate declaration, and no other origin information is present.

Describe the solution you'd like An optional property on Rule and IConstraint that indicate their origin in the spec source.

Describe alternatives you've considered An editor service that lists all rules for a predicate.

Additional context

Virtlink commented 8 months ago

This would be useful, for example, to exclude all exprOk rule definition in the BinaryOperators as part of reference synthesis, as those are never valid references.