Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass `context' to error formatters #756

Merged
merged 1 commit into from
Apr 7, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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