Skip to content

Commit b9cd882

Browse files
author
Kanchalai Tanglertsampan
committed
Address PR: use getDefaultLibLocation to get directory
1 parent ade9287 commit b9cd882

2 files changed

Lines changed: 16 additions & 3 deletions

File tree

src/compiler/program.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -638,7 +638,7 @@ namespace ts {
638638
return {
639639
getSourceFile,
640640
getDefaultLibLocation,
641-
getDefaultLibFileName: options => combinePaths(getDirectoryPath(normalizePath(sys.getExecutingFilePath())), getDefaultLibFileName(options)),
641+
getDefaultLibFileName: options => combinePaths(getDefaultLibLocation(), getDefaultLibFileName(options)),
642642
writeFile,
643643
getCurrentDirectory: memoize(() => sys.getCurrentDirectory()),
644644
useCaseSensitiveFileNames: () => sys.useCaseSensitiveFileNames,

src/compiler/tsc.ts

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -712,8 +712,21 @@ namespace ts {
712712
output += usage + makePadding(marginLength - usage.length + 2) + description + sys.newLine;
713713

714714
if (kindsList) {
715-
for (const kind of kindsList) {
716-
output += makePadding(marginLength + 4) + kind + sys.newLine;
715+
const maxElementsInLine = 6;
716+
for (let idx = 0; idx < kindsList.length; idx++) {
717+
// We have to manually cut the line because the list is too long and it will be very hard to read with auto-wrapping
718+
// It will print in the following format:
719+
// 'es5' 'es6' 'es2015'
720+
// 'es7' 'es2016' 'dom'
721+
// ....
722+
const positionInLine = idx % maxElementsInLine;
723+
if (positionInLine === 0) {
724+
output += makePadding(marginLength + 4);
725+
}
726+
output += kindsList[idx] + " ";
727+
if (positionInLine === maxElementsInLine - 1) {
728+
output += sys.newLine;
729+
}
717730
}
718731
output += sys.newLine;
719732
}

0 commit comments

Comments
 (0)