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

Make highlighting backwards compatible with older translator versions #298

Merged
merged 2 commits into from
Mar 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/helpers/ClauseResultsHelpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,14 @@ export function findAllLocalIdsInStatement(
aliasMap[v] = statement.expression.localId;
// Determine the localId for this alias.
if (statement.localId) {
alId = statement.localId;
// Older translator versions require with statements to use the statement.expression.localId + 1 as the alias Id
// even if the statement already has a localId. There is not a clear mapping for alias with statements in the new
// translator, so they will go un highlighted but this will not affect coverage calculation
if (statement.type === 'With' || statement.type === 'Without') {
alId = (parseInt(statement.expression.localId, 10) + 1).toString();
lmd59 marked this conversation as resolved.
Show resolved Hide resolved
} else {
alId = statement.localId;
}
} else {
// Older translator versions created an elm_annotation localId that was not always in the elm. This was a
// single increment up from the expression that defines the alias.
Expand Down
Loading