Merge pull request #22842 from uniqueiniquity/outliningLineEnding

Make region outlining more sensitive to CRLF
This commit is contained in:
Benjamin Lichtman 2018-03-23 16:02:33 -07:00 committed by GitHub
commit 383751866e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -33,7 +33,7 @@ namespace ts.OutliningElementsCollector {
const currentLineStart = lineStarts[i];
const lineEnd = i + 1 === lineStarts.length ? sourceFile.getEnd() : lineStarts[i + 1] - 1;
const lineText = sourceFile.text.substring(currentLineStart, lineEnd);
const result = lineText.match(/^\s*\/\/\s*#(end)?region(?:\s+(.*))?$/);
const result = lineText.match(/^\s*\/\/\s*#(end)?region(?:\s+(.*))?(?:\r)?$/);
if (!result || isInComment(sourceFile, currentLineStart)) {
continue;
}