Files
react-native-devtools-frontend/front_end/entrypoints/formatter_worker
Yang Guo 5e45944cc3 Fix pretty print for expressions within template literals
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>
2025-01-14 01:58:38 -08:00
..
2021-04-26 13:48:40 +00:00