Skip to content

Indentation failure with unclosed JSX element #6281

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
DanielRosenwasser opened this issue Dec 29, 2015 · 7 comments
Open

Indentation failure with unclosed JSX element #6281

DanielRosenwasser opened this issue Dec 29, 2015 · 7 comments
Labels
Bug A bug in TypeScript Domain: JSX/TSX Relates to the JSX parser and emitter
Milestone

Comments

@DanielRosenwasser
Copy link
Member

var x =
    <div>
        <input type="text" name="name">
    </div>

namespace foo {
/**/

Press enter at /**/.

Description:

getIndentationAtPosition('C:\Users\drosen\AppData\Local\Temp\~vs8E0D.tsx', 94)

StackTrace:

Error: Debug Failure. False expression: 
   at assert (:1645:17)
   at find (:41847:13)
   at find (:41843:25)
   at find (:41843:25)
   at find (:41843:25)
   at find (:41843:25)
   at find (:41843:25)
   at find (:41843:25)
   at find (:41843:25)
   at find (:41843:25)
   at findPrecedingToken (:41808:9)
   at getIndentation (:44508:17)
   at getIndentationAtPosition (:50435:13)
   at Anonymous function (:52193:17)
   at simpleForwardCall (:51951:9)
   at forwardJSONCall (:51967:13)
   at forwardJSONCall (:52013:13)
   at getIndentationAtPosition (:52191:13)
@DanielRosenwasser DanielRosenwasser added Bug A bug in TypeScript Domain: JSX/TSX Relates to the JSX parser and emitter High Priority labels Dec 29, 2015
@DanielRosenwasser
Copy link
Member Author

Marking this as high priority because it actually makes VS crash for me.

@vladima
Copy link
Contributor

vladima commented Dec 29, 2015

Does not repro for me using the latest bits from master. Can you attach a fourslash test that shows the problem?

indentationinjsx

@DanielRosenwasser
Copy link
Member Author

The repro wasn't apparent because I think you need a newline below the namespace. I've updated the original comment.

@vladima
Copy link
Contributor

vladima commented Dec 29, 2015

sure, still don't see it.
indentationinjsx2

@DanielRosenwasser DanielRosenwasser changed the title Indentation crash with unclosed JSX element Indentation failure with unclosed JSX element Dec 29, 2015
@DanielRosenwasser
Copy link
Member Author

As discussed offline, this is not a crash (you need to have dev mode enabled), but this is still an issue.

@DanielRosenwasser
Copy link
Member Author

More minimal repro:

var x = <div bar={10}>
/**/

Press enter at /**/

@mhegazy mhegazy modified the milestones: TypeScript 2.1, TypeScript 2.0 Jun 8, 2016
@mhegazy mhegazy modified the milestones: TypeScript 2.1, Future Sep 29, 2016
@mhegazy mhegazy assigned mhegazy and unassigned vladima Mar 24, 2017
@Andarist
Copy link
Contributor

Andarist commented Aug 3, 2023

The expected result isn't completely clear for me here and I can't assess if this is already fixed or not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Domain: JSX/TSX Relates to the JSX parser and emitter
Projects
None yet
Development

No branches or pull requests

4 participants