Make highlighting backwards compatible with older translator versions #298
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Our most recent PR addresses updates to clause coverage calculation and highlighting that were necessary to reflect the functionality of the
3.7.1
version of the cql to elm translator. Due to the nature of changes to localId assignment in the translator versions, this broke just the highlighting of some aliases (no affect to clause coverage calculation) for measures that use older translator versions. This PR makes sure that highlighting is backwards compatible with the older translator version (there should be no change to highlighting).New behavior
I have a comment in the code that details these translator version quirks, but essentially we can't always use the
statement.localId
if it exists for measures that were translated using the other translator. I was able to narrow this down to justWith
statements.Code changes
ClauseResultsHelpers.ts
- ONLY usestatement.localId
if it is NOT a with statement. In the older translator version, with statements require the use of thestatement.expression.localId + 1
. In the new translator version, you will see that these aliases are not highlighted. This is because there is no longer a clear mapping to the localId in the ELM annotation that we want (pending translator fix).Testing guidance
master
branch, you will see that the MAT6725 Good (pre translator change) bundle and test cases produce 99.7% clause coverage highlighting HOWEVER there are aliases that are unhiglighted. On the1.3.3
version offqm-execution
, MAT6725 Good (pre translator change) bundle and test cases produce 99.7% clause coverage highlighting with no highlighting issues. This is the desired behavior. On this branch (alias-highlighting-fix
), the MAT6725 Good (pre translator change) bundle and test cases should produce the SAME results. as1.3.3
(99.7% coverage, no highlighting issues).master
branch, you will see that the MAT6725 Bad (post translator change) bundle and test cases produce 99.5% clause coverage highlighting and there are aliases that are un highlighted. This is to be expected (need translator fix for this). On this branch, we want the same results.1.3.3
.