Skip to content

Commit a3122dd

Browse files
committed
fix: positions wrong with multiple quasis in tag name
1 parent 02208cd commit a3122dd

File tree

20 files changed

+61
-53
lines changed

20 files changed

+61
-53
lines changed

src/__tests__/fixtures/argument-and-params/__snapshots__/argument-and-params.expected.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
1╭─ <${x}(y)/>
22
│ │ ││ ╰─ openTagEnd:selfClosed "/>"
3-
│ │ │─ tagArgs.value
4-
│ │ │╰─ tagName.quasis[1]
5-
│ │ ╰─ tagArgs "(y)"
3+
│ │ │─ tagArgs.value
4+
│ │ ├─ tagArgs "(y)"
5+
│ │ ╰─ tagName.quasis[1]
66
│ ├─ tagName.expressions[0] "${x}"
77
│ ├─ tagName.quasis[0]
88
╰─ ╰─ tagName "${x}"
99
2╭─ <${x}|y|/>
1010
│ │ ││ ╰─ openTagEnd:selfClosed "/>"
11-
│ │ │─ tagParams.value
12-
│ │ │╰─ tagName.quasis[1]
13-
│ │ ╰─ tagParams "|y|"
11+
│ │ │─ tagParams.value
12+
│ │ ├─ tagParams "|y|"
13+
│ │ ╰─ tagName.quasis[1]
1414
│ ├─ tagName.expressions[0] "${x}"
1515
│ ├─ tagName.quasis[0]
1616
╰─ ╰─ tagName "${x}"
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
1╭─ ${test} foo=123
2-
│ │ │ ││ ├─ closeTag(${test})
3-
│ │ │ ││ ╰─ openTagEnd
4-
│ │ │ │╰─ attrValue.value "123"
5-
│ │ │ ╰─ attrValue "=123"
6-
│ │ ─ attrName "foo"
7-
│ │ ╰─ tagName.quasis[1]
2+
│ │ │ ││ ├─ closeTag(${test})
3+
│ │ │ ││ ╰─ openTagEnd
4+
│ │ │ │╰─ attrValue.value "123"
5+
│ │ │ ╰─ attrValue "=123"
6+
│ │ │╰─ attrName "foo"
7+
│ │ ╰─ tagName.quasis[1]
88
│ ├─ tagName.expressions[0] "${test}"
99
│ ├─ tagName.quasis[0]
1010
╰─ ╰─ tagName "${test}"
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
1╭─ <${test} foo=123/>
2-
│ │ │ ││ ╰─ openTagEnd:selfClosed "/>"
3-
│ │ │ │╰─ attrValue.value "123"
4-
│ │ │ ╰─ attrValue "=123"
5-
│ │ ─ attrName "foo"
6-
│ │ ╰─ tagName.quasis[1]
2+
│ │ │ ││ ╰─ openTagEnd:selfClosed "/>"
3+
│ │ │ │╰─ attrValue.value "123"
4+
│ │ │ ╰─ attrValue "=123"
5+
│ │ │╰─ attrName "foo"
6+
│ │ ╰─ tagName.quasis[1]
77
│ ├─ tagName.expressions[0] "${test}"
88
│ ├─ tagName.quasis[0]
99
╰─ ╰─ tagName "${test}"

src/__tests__/fixtures/shorthand-class-dynamic-literal-prefix/__snapshots__/shorthand-class-dynamic-literal-prefix.expected.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
1╭─ .bar${data.foo}
2-
│ ││ │ │╰─ tagShorthandClass.quasis[1]
32
│ ││ │ ├─ closeTag()
4-
│ ││ │ ╰─ openTagEnd
3+
│ ││ │ ├─ openTagEnd
4+
│ ││ │ ╰─ tagShorthandClass.quasis[1]
55
│ ││ ╰─ tagShorthandClass.expressions[0] "${data.foo}"
66
│ │╰─ tagShorthandClass.quasis[0] "bar"
77
│ ├─ tagShorthandClass ".bar${data.foo}"

src/__tests__/fixtures/shorthand-class-dynamic-literal-suffix/__snapshots__/shorthand-class-dynamic-literal-suffix.expected.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
1╭─ .${data.foo}-bar
2-
│ ││ ├─ closeTag()
3-
│ ││ ╰─ openTagEnd
4-
│ ││ ╰─ tagShorthandClass.quasis[1] "bar"
2+
│ ││ ├─ closeTag()
3+
│ ││ ╰─ openTagEnd
4+
│ ││ ╰─ tagShorthandClass.quasis[1] "-bar"
55
│ │├─ tagShorthandClass.expressions[0] "${data.foo}"
66
│ │╰─ tagShorthandClass.quasis[0]
77
│ ├─ tagShorthandClass ".${data.foo}-bar"

src/__tests__/fixtures/shorthand-class-dynamic/__snapshots__/shorthand-class-dynamic.expected.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
1╭─ span.${data.foo}
2-
│ │ ││ │╰─ tagShorthandClass.quasis[1]
32
│ │ ││ ├─ closeTag(span)
4-
│ │ ││ ╰─ openTagEnd
3+
│ │ ││ ├─ openTagEnd
4+
│ │ ││ ╰─ tagShorthandClass.quasis[1]
55
│ │ │├─ tagShorthandClass.expressions[0] "${data.foo}"
66
│ │ │╰─ tagShorthandClass.quasis[0]
77
│ │ ╰─ tagShorthandClass ".${data.foo}"

src/__tests__/fixtures/shorthand-id-dynamic-literal-prefix/__snapshots__/shorthand-id-dynamic-literal-prefix.expected.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
1╭─ #bar${data.foo}
2-
│ ││ │ │╰─ tagShorthandId.quasis[1]
32
│ ││ │ ├─ closeTag()
4-
│ ││ │ ╰─ openTagEnd
3+
│ ││ │ ├─ openTagEnd
4+
│ ││ │ ╰─ tagShorthandId.quasis[1]
55
│ ││ ╰─ tagShorthandId.expressions[0] "${data.foo}"
66
│ │╰─ tagShorthandId.quasis[0] "bar"
77
│ ├─ tagShorthandId "#bar${data.foo}"

src/__tests__/fixtures/shorthand-id-dynamic-literal-suffix/__snapshots__/shorthand-id-dynamic-literal-suffix.expected.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
1╭─ #${data.foo}-bar
2-
│ ││ ├─ closeTag()
3-
│ ││ ╰─ openTagEnd
4-
│ ││ ╰─ tagShorthandId.quasis[1] "bar"
2+
│ ││ ├─ closeTag()
3+
│ ││ ╰─ openTagEnd
4+
│ ││ ╰─ tagShorthandId.quasis[1] "-bar"
55
│ │├─ tagShorthandId.expressions[0] "${data.foo}"
66
│ │╰─ tagShorthandId.quasis[0]
77
│ ├─ tagShorthandId "#${data.foo}-bar"

src/__tests__/fixtures/shorthand-id-dynamic/__snapshots__/shorthand-id-dynamic.expected.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
1╭─ span#${data.foo}
2-
│ │ ││ │╰─ tagShorthandId.quasis[1]
32
│ │ ││ ├─ closeTag(span)
4-
│ │ ││ ╰─ openTagEnd
3+
│ │ ││ ├─ openTagEnd
4+
│ │ ││ ╰─ tagShorthandId.quasis[1]
55
│ │ │├─ tagShorthandId.expressions[0] "${data.foo}"
66
│ │ │╰─ tagShorthandId.quasis[0]
77
│ │ ╰─ tagShorthandId "#${data.foo}"

src/__tests__/fixtures/tag-name-expression-literal-prefix-attrs/__snapshots__/tag-name-expression-literal-prefix-attrs.expected.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
1╭─ <foo-${bar} hello="world">
2-
│ │ │ │ ││ ╰─ openTagEnd
3-
│ │ │ │ │╰─ attrValue.value "\"world\""
4-
│ │ │ │ ╰─ attrValue "=\"world\""
5-
│ │ │ ─ attrName "hello"
6-
│ │ │ ╰─ tagName.quasis[1]
2+
│ │ │ │ ││ ╰─ openTagEnd
3+
│ │ │ │ │╰─ attrValue.value "\"world\""
4+
│ │ │ │ ╰─ attrValue "=\"world\""
5+
│ │ │ │╰─ attrName "hello"
6+
│ │ │ ╰─ tagName.quasis[1]
77
│ │ ╰─ tagName.expressions[0] "${bar}"
88
│ ├─ tagName.quasis[0] "foo-"
99
╰─ ╰─ tagName "foo-${bar}"

0 commit comments

Comments
 (0)