Address PR: use getDefaultLibLocation to get directory

This commit is contained in:
Kanchalai Tanglertsampan 2016-03-30 10:26:39 -07:00
parent ade92873bc
commit b9cd882ae7
2 changed files with 16 additions and 3 deletions

View File

@ -638,7 +638,7 @@ namespace ts {
return {
getSourceFile,
getDefaultLibLocation,
getDefaultLibFileName: options => combinePaths(getDirectoryPath(normalizePath(sys.getExecutingFilePath())), getDefaultLibFileName(options)),
getDefaultLibFileName: options => combinePaths(getDefaultLibLocation(), getDefaultLibFileName(options)),
writeFile,
getCurrentDirectory: memoize(() => sys.getCurrentDirectory()),
useCaseSensitiveFileNames: () => sys.useCaseSensitiveFileNames,

View File

@ -712,8 +712,21 @@ namespace ts {
output += usage + makePadding(marginLength - usage.length + 2) + description + sys.newLine;
if (kindsList) {
for (const kind of kindsList) {
output += makePadding(marginLength + 4) + kind + sys.newLine;
const maxElementsInLine = 6;
for (let idx = 0; idx < kindsList.length; idx++) {
// We have to manually cut the line because the list is too long and it will be very hard to read with auto-wrapping
// It will print in the following format:
// 'es5' 'es6' 'es2015'
// 'es7' 'es2016' 'dom'
// ....
const positionInLine = idx % maxElementsInLine;
if (positionInLine === 0) {
output += makePadding(marginLength + 4);
}
output += kindsList[idx] + " ";
if (positionInLine === maxElementsInLine - 1) {
output += sys.newLine;
}
}
output += sys.newLine;
}