-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Compiler flag to specify line ending #2921
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
Hi @kmashint, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution! TTYL, MSBOT; |
"category": "Message", | ||
"code": 6062 | ||
}, | ||
"Argument for --newLine option must be 'CRLF' or 'LF'.": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'--newLine' in single quotes.
Adjusted for comments thus far. I'll look into test cases tomorrow. |
@@ -91,6 +91,11 @@ module ts { | |||
} | |||
} | |||
|
|||
let newLine = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
formatting, and use const.
Thanks @kmashint for the change. We will need a test for the new flag. to add a test,
|
I found and started to make the harness.ts adjustments; the runtests is taking forever so I'll check in the morning. |
Yeah, there's been some perf drop in recent versions of Node that will make it...worse. I've been on 0.10.33. I've recently been working to parallelize the tests. |
Stalled this week catching up on paid work ... should have some time on the weekend to work on unit tests. |
I thought I had this working locally, but I'll try to find other examples of an expected failure in unit test cases.
|
@@ -822,7 +825,8 @@ module Harness { | |||
scriptTarget: ts.ScriptTarget, | |||
useCaseSensitiveFileNames: boolean, | |||
// the currentDirectory is needed for rwcRunner to passed in specified current directory to compiler host | |||
currentDirectory?: string): ts.CompilerHost { | |||
currentDirectory?: string, | |||
newLineKind?: ts.NewLineKind): ts.CompilerHost { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't use tabs
I've introduced a @ normalizenewline option to work as the old one did in contextualTyping.js. I'll adjust for merge conflicts tomorrow. |
OK, I've rebased my changes on top of microsoft/TypeScript. I tried using @ newline for both the new arguments and the old usage in contextualTyping.js but there were side-effects since the old usage affects not only the JS file but other debugging output files so I adjusted contextualTyping.js to use @ normalizenewline and all tests pass without further special treatment. |
Thanks @kmashint! |
Happy to contribute in a small way, I hope others find it useful as well. |
This is a first pass, unit tests still TODO, of adding a compiler flag to specify the line ending:
#1693
--newLine NEWLINE Emit newline: 'CRLF' (dos) or 'LF' (unix).
I'll next add unit tests as noted in this follow-up issue but please note any comments on code thus far:
#2918
i've signed the contributor agreement.