Skip to content

Commit

Permalink
Pass `context' to error formatters (#756)
Browse files Browse the repository at this point in the history
  • Loading branch information
gustavderdrache authored and johnnyreilly committed Apr 7, 2018
1 parent eb8bbf8 commit 3a73e62
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export interface ErrorInfo {
file: string;
line: number;
character: number;
context: string;
}

export interface AsyncCallback {
Expand Down
5 changes: 3 additions & 2 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export function formatErrors(
file === undefined
? undefined
: file.getLineAndCharacterOfPosition(diagnostic.start!);
const errorInfo = {
const errorInfo: ErrorInfo = {
code: diagnostic.code,
severity: compiler.DiagnosticCategory[
diagnostic.category
Expand All @@ -84,7 +84,8 @@ export function formatErrors(
),
file: file === undefined ? '' : path.normalize(file.fileName),
line: position === undefined ? 0 : position.line + 1,
character: position === undefined ? 0 : position.character + 1
character: position === undefined ? 0 : position.character + 1,
context
};

const message =
Expand Down

0 comments on commit 3a73e62

Please sign in to comment.