Skip to content

Format Document in VS2013 Update 4 breaks particular Typescript #2115

@John15213

Description

@John15213

Hello

I'm not sure if the Typescript team manages the code that runs for formatting TypeScript in the Visual Studio editor (via Edit | Advanced | Format Document) or not, but if so see the link below. For me, the code formatter is mangling some comments, breaking the code. The connect item has attachments with the original before and after samples as zip files. Thank You

https://connect.microsoft.com/VisualStudio/Feedback/Details/1145387

Code before and after

/* before */

var f = function (j) {

switch (j) {
    case 1:
            /* when current checkbox has focus, Firefox has changed check state already
            on SPACE bar press only
            IE does not have issue, use the CSS class
            input:focus[type=checkbox] (z-index = 31290)
            to determine whether checkbox has focus or not 
            */
        break;
    case 2:
        break;

}

}

/* after */

var f = function (j) {

switch (j) {
    case 1:
        ent checkbox has focus, Firefox has changed check state already
         press only
        have issue, use the CSS class
        type=checkbox] (z-index = 31290)
         whether checkbox has focus or not 
                    ;
    case 2:
        break;

}

}

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptFixedA PR has been merged for this issue

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions