mirror of
https://github.com/danbulant/oxc
synced 2026-05-24 12:21:58 +00:00
feat(prettier): basic TaggedTemplateExpression printing (#1486)
This commit is contained in:
parent
4fb4a85ab1
commit
8934ddb590
1 changed files with 19 additions and 1 deletions
|
|
@ -916,6 +916,12 @@ impl<'a> Format<'a> for TSTypeParameterDeclaration<'a> {
|
|||
}
|
||||
}
|
||||
|
||||
impl<'a> Format<'a> for TSTypeParameterInstantiation<'a> {
|
||||
fn format(&self, p: &mut Prettier<'a>) -> Doc<'a> {
|
||||
Doc::Line
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> Format<'a> for TSTupleElement<'a> {
|
||||
fn format(&self, p: &mut Prettier<'a>) -> Doc<'a> {
|
||||
Doc::Line
|
||||
|
|
@ -1732,7 +1738,19 @@ impl<'a> Format<'a> for TemplateElement {
|
|||
|
||||
impl<'a> Format<'a> for TaggedTemplateExpression<'a> {
|
||||
fn format(&self, p: &mut Prettier<'a>) -> Doc<'a> {
|
||||
Doc::Line
|
||||
let mut parts = p.vec();
|
||||
|
||||
parts.push(format!(p, self.tag));
|
||||
|
||||
if let Some(type_parameters) = &self.type_parameters {
|
||||
parts.push(string!(p, "<"));
|
||||
parts.push(format!(p, type_parameters));
|
||||
parts.push(string!(p, ">"));
|
||||
}
|
||||
|
||||
parts.push(format!(p, self.quasi));
|
||||
|
||||
Doc::Array(parts)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue