Skip to content

Commit f9f8d01

Browse files
authored
Fixup misported TokensAreOnSameLine (#64597)
1 parent cb72b2e commit f9f8d01

4 files changed

Lines changed: 2 additions & 4 deletions

File tree

‎tsc/internal/format/context.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ func (this *FormattingContext) NextNodeAllOnSameLine() bool {
101101

102102
func (this *FormattingContext) TokensAreOnSameLine() bool {
103103
if this.tokensAreOnSameLine == core.TSUnknown {
104-
this.tokensAreOnSameLine = this.rangeIsOnOneLine(core.NewTextRange(this.currentTokenSpan.Loc.Pos(), this.nextTokenSpan.Loc.End()))
104+
this.tokensAreOnSameLine = this.rangeIsOnOneLine(core.NewTextRange(this.currentTokenSpan.Loc.Pos(), this.nextTokenSpan.Loc.Pos()))
105105
}
106106
return this.tokensAreOnSameLine == core.TSTrue
107107
}

‎tsc/internal/fourslash/tests/formatDocumentNoCrashJsxAttrUnterminatedString_test.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ const x = <HangupButton customClass = 'ha
1616
f, done := fourslash.NewFourslash(t, nil /*capabilities*/, content)
1717
defer done()
1818
f.FormatDocument(t, "")
19-
f.VerifyCurrentFileContent(t, "const x = <HangupButton customClass= 'ha\n")
19+
f.VerifyCurrentFileContent(t, "const x = <HangupButton customClass='ha\n")
2020
}

‎tsc/internal/fourslash/tests/formatNoSpaceAfterTemplateHeadAndMiddle_test.go‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import (
99
)
1010

1111
func TestFormatNoSpaceAfterTemplateHeadAndMiddle(t *testing.T) {
12-
t.Skip("Known failing fourslash test")
1312
t.Parallel()
1413
defer testutil.RecoverAndFail(t, "Panic on fourslash test")
1514
const content = `const a1 = ` + "`" + `${ 1 }${ 1 }` + "`" + `;

‎tsc/internal/fourslash/tests/formatSpaceAfterTemplateHeadAndMiddle_test.go‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import (
99
)
1010

1111
func TestFormatSpaceAfterTemplateHeadAndMiddle(t *testing.T) {
12-
t.Skip("Known failing fourslash test")
1312
t.Parallel()
1413
defer testutil.RecoverAndFail(t, "Panic on fourslash test")
1514
const content = `const a1 = ` + "`" + `${1}${1}` + "`" + `;

0 commit comments

Comments
 (0)