Skip to content

getIndentation fails with JsxElement #4332

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

Closed
saschanaz opened this issue Aug 16, 2015 · 1 comment
Closed

getIndentation fails with JsxElement #4332

saschanaz opened this issue Aug 16, 2015 · 1 comment
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue

Comments

@saschanaz
Copy link
Contributor

/// <reference path='fourslash.ts' />

//@Filename: file.tsx
////(function () {
////    return (
////        <div>
////            <div>
////            </div>
////            /*indent2*/
////        </div>
////    )
////})


format.document();
goTo.marker("indent2");
verify.indentationIs(12);

This causes error (in master branch):

Error: Debug Failure. False expression:
 at Object.assert (eval at <anonymous> (C:\Users\sasch_000\Documents\GitHub\typescript-f\built\local\run.js:53472:13), <anonymous>:1549:23)

Inserting a text line prevents this error. (foo)

//@Filename: file.tsx
////(function () {
////    return (
////        <div>
////            <div>
////            </div>
////            foo
////            /*indent2*/
////        </div>
////    )
////})
@DanielRosenwasser
Copy link
Member

More minimal repro (#4515) is

<div>/**/

with a stack trace of

Description:

getIndentationAtPosition('C:\Users\drosen\file1.tsx', 7)

Message:

StackTrace:

Error: Debug Failure. False expression: 
   at assert (:1558:17)
   at find (:38781:13)
   at find (:38776:29)
   at find (:38776:29)
   at find (:38776:29)
   at findPrecedingToken (:38751:9)
   at getIndentation (:41411:17)
   at getIndentationAtPosition (:47287:13)
   at Anonymous function (:48969:17)
   at simpleForwardCall (:48727:9)
   at forwardJSONCall (:48743:13)
   at forwardJSONCall (:48789:13)
   at getIndentationAtPosition (:48967:13)

@vladima vladima added the Fixed A PR has been merged for this issue label Sep 3, 2015
@mhegazy mhegazy added this to the TypeScript 1.6.2 milestone Sep 3, 2015
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue
Projects
None yet
Development

No branches or pull requests

4 participants