Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
ba7fade
Add support to tell whether output directs to a terminal emulator.
DanielRosenwasser Jul 1, 2015
f660bd3
Got "prettier" error printing working.
DanielRosenwasser Jul 1, 2015
17f443a
Just squiggle the entire line for middle lines (sans trailing space).
DanielRosenwasser Jul 1, 2015
fdbea8b
Give the new reporter a more reasonable name.
DanielRosenwasser Jul 1, 2015
d8e462d
Make output reliant on whether stdout redirects to a terminal; use fo…
DanielRosenwasser Jul 1, 2015
cc6b04c
Bring back 'reportDiagnostics'.
DanielRosenwasser Jul 1, 2015
99f6985
Don't expand tabs; just use a space.
DanielRosenwasser Jul 17, 2015
85b54e8
Fixed out of bounds error; made index start directly at the line number.
DanielRosenwasser Jul 17, 2015
dda058b
Use 'process.stdout.write' to ensure colors get displayed correctly o…
DanielRosenwasser Jul 24, 2015
3c04dff
Limit errors to 5 lines, fixed some other issues.
DanielRosenwasser Aug 18, 2015
ea1882d
Merge branch 'master' into iFeelPrettyErr
DanielRosenwasser Aug 18, 2015
44f3c0c
Stylize gutter.
DanielRosenwasser Aug 19, 2015
ac5bed8
Added '--diagnosticStyle' compiler argument with options 'simple' and…
DanielRosenwasser Sep 19, 2015
7c73a66
Merge branch 'master' into iFeelPrettyErr
DanielRosenwasser Oct 6, 2015
2b4febe
Moved JSX diagnostics to a more sensical spot.
DanielRosenwasser Oct 6, 2015
c3e00a2
Only use colors if we are certain we are using a pseudoterminal.
DanielRosenwasser Oct 6, 2015
5c5fca6
Just make the compiler option internal.
DanielRosenwasser Oct 6, 2015
87554cb
Merge branch 'master' into iFeelPrettyErr
DanielRosenwasser Oct 6, 2015
fa2e614
Merge branch 'master' into iFeelPrettyErr
DanielRosenwasser Oct 31, 2015
48c2bb1
Fixed 'tsconfig.json' ordering.
DanielRosenwasser Oct 31, 2015
4219c5f
Added colors to diagnostic types, addressed some CR feedback.
DanielRosenwasser Nov 2, 2015
654cbd9
Just name the option 'pretty' for now.
DanielRosenwasser Nov 2, 2015
40f10ab
Forget about tty detection. It won't work in build tools.
DanielRosenwasser Nov 2, 2015
e5f1053
Merge branch 'master' into iFeelPrettyErr
DanielRosenwasser Nov 2, 2015
32b259e
Merge branch 'master' into iFeelPrettyErr
DanielRosenwasser Nov 2, 2015
ce24bcb
;
DanielRosenwasser Nov 2, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge branch 'master' into iFeelPrettyErr
  • Loading branch information
DanielRosenwasser committed Oct 31, 2015
commit fa2e614f9f4cb58e09e9613350a34e46540c09a9
50 changes: 49 additions & 1 deletion src/compiler/commandLineParser.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/// <reference path="sys.ts"/>
/// <reference path="types.ts"/>
/// <reference path="core.ts"/>
/// <reference path="diagnosticInformationMap.generated.ts"/>
/// <reference path="scanner.ts"/>

namespace ts {
Expand Down Expand Up @@ -468,4 +469,51 @@ namespace ts {
return fileNames;
}
}
}

export function convertCompilerOptionsFromJson(jsonOptions: any, basePath: string): { options: CompilerOptions, errors: Diagnostic[] } {
let options: CompilerOptions = {};
let errors: Diagnostic[] = [];

if (!jsonOptions) {
return { options, errors };
}

let optionNameMap = arrayToMap(optionDeclarations, opt => opt.name);

for (let id in jsonOptions) {
if (hasProperty(optionNameMap, id)) {
let opt = optionNameMap[id];
let optType = opt.type;
let value = jsonOptions[id];
let expectedType = typeof optType === "string" ? optType : "string";
if (typeof value === expectedType) {
if (typeof optType !== "string") {
let key = value.toLowerCase();
if (hasProperty(optType, key)) {
value = optType[key];
}
else {
errors.push(createCompilerDiagnostic((<CommandLineOptionOfCustomType>opt).error));
value = 0;
}
}
if (opt.isFilePath) {
value = normalizePath(combinePaths(basePath, value));
if (value === "") {
value = ".";
}
}
options[opt.name] = value;
}
else {
errors.push(createCompilerDiagnostic(Diagnostics.Compiler_option_0_requires_a_value_of_type_1, id, expectedType));
}
}
else {
errors.push(createCompilerDiagnostic(Diagnostics.Unknown_compiler_option_0, id));
}
}

return { options, errors };
}
}
3 changes: 3 additions & 0 deletions src/compiler/tsc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,9 @@ namespace ts {
reportDiagnostic = reportDiagnosticWithColorAndContext;
}

// reset the cache of existing files
cachedExistingFiles = {};

let compileResult = compile(rootFileNames, compilerOptions, compilerHost);

if (!compilerOptions.watch) {
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.