mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-10-29 01:15:59 +08:00
A TemplateLiteral consists of alternating TemplateElement and
non-TemplateElement nodes, with tokens in between:
<TemplateLiteral>
<tokens> -- formatted in #beforeVisit for TemplateElement
<TemplateElement> -- formatted in #afterVisit for TemplateElement
<tokens>
<TemplateElement>
<tokens> -- formatted in #beforeVisit for Expression
<Expression> -- formatted in #afterVisit for Expression
...
</Expression>
</TemplateLiteral>
We must not insert spaces while formatting within a TemplateLiteral
with the exception of the Expression. This happens within
the #afterVisit call to non-TemplateElement.
Fixed: 386857215
Change-Id: I0269747e825f64ecccb32c52f5a372b3d915e4ed
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6168856
Auto-Submit: Yang Guo <yangguo@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>