Skip to content

Commit 51c9f6a

Browse files
committed
fixup: template elements should not receive tags
1 parent d3fd6c9 commit 51c9f6a

File tree

1 file changed

+6
-4
lines changed
  • packages/async-rewriter3/src

1 file changed

+6
-4
lines changed

packages/async-rewriter3/src/lib.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use std::{borrow::Borrow, collections::VecDeque, fmt::Debug};
22
use wasm_bindgen::prelude::*;
3-
use rslint_parser::{ast::{ArrowExpr, AssignExpr, CallExpr, ClassDecl, Constructor, Expr, ExprOrBlock, ExprStmt, FnDecl, FnExpr, Literal, Method, NameRef, ObjectPatternProp, ParameterList, Pattern, PropName, ReturnStmt, ThisExpr, UnaryExpr, VarDecl}, parse_text, AstNode, SyntaxNode, TextSize};
3+
use rslint_parser::{ast::{ArrowExpr, AssignExpr, CallExpr, ClassDecl, Constructor, Expr, ExprOrBlock, ExprStmt, FnDecl, FnExpr, Literal, Method, NameRef, ObjectPatternProp, ParameterList, Pattern, PropName, ReturnStmt, ThisExpr, UnaryExpr, VarDecl}, parse_text, AstNode, SyntaxKind, SyntaxNode, TextSize};
44

55
#[derive(Debug)]
66
enum InsertionText {
@@ -240,9 +240,11 @@ fn collect_insertions(node: &SyntaxNode, nesting_depth: u32) -> InsertionList {
240240
let child_insertions = &mut collect_insertions(&child, nesting_depth + if is_function_node(node) { 1 } else { 0 });
241241
{
242242
let kind = child.kind();
243-
insertions.push_back(Insertion::new_dynamic(range.start(),
244-
["/*", format!("{kind:#?}").as_str(), "*/"].concat()
245-
));
243+
if kind != SyntaxKind::TEMPLATE_ELEMENT {
244+
insertions.push_back(Insertion::new_dynamic(range.start(),
245+
["/*", format!("{kind:#?}").as_str(), "*/"].concat()
246+
));
247+
}
246248
}
247249
if FnDecl::can_cast(child.kind()) {
248250
let as_fn = FnDecl::cast(child).unwrap();

0 commit comments

Comments
 (0)