-
-
Notifications
You must be signed in to change notification settings - Fork 250
Closed
Labels
Description
Hi,
I am currently writing a custom tree adapter restructuring the source code location:
{
start: { offset: 0, line: 1, column: 1 },
end: { offset: 0, line: 1, column: 1 },
}The problem is that elements closing tag are not correctly handled in the parser mixin.
The location is retrieved using the tree adapter but the end location is set directly on the retrieved location, not using the tree adapter.
Therefore the result after parsing is:
{
start: { offset: 0, line: 1, column: 1 },
end: { offset: 0, line: 1, column: 1 },
endTag: ...,
endLine: 1,
endCol: 10,
endOffset: 9,
}I think there are three possible solutions:
- Call the
setSourceCodeLocationonly after the closing tag is parsed - Call the
setSourceCodeLocationtwice (once after the opening tag and once for the closing tag) - Introduce a new method
updateSourceCodeLocationfor this purpose
Personally I would prefer the last option.
If this change is approved, I gladly submit a PR for the proposed solution.