refactor(compiler-cli): make makeTemplateDiagnostic
wrapper error (#42984)
specific This commit makes the wrapper function `makeTemplateDiagnostic` take an ErrorCode as a type for the `ts.Diagnostic`s to be generated. Refs #42966 PR Close #42984
This commit is contained in:
parent
3a092d6cea
commit
c055cfe281
@ -168,9 +168,9 @@ export interface TemplateTypeChecker {
|
|||||||
/**
|
/**
|
||||||
* Constructs a `ts.Diagnostic` for a given `ParseSourceSpan` within a template.
|
* Constructs a `ts.Diagnostic` for a given `ParseSourceSpan` within a template.
|
||||||
*/
|
*/
|
||||||
makeTemplateDiagnostic(
|
makeTemplateDiagnostic<T extends ErrorCode>(
|
||||||
clazz: ts.ClassDeclaration, sourceSpan: ParseSourceSpan, category: ts.DiagnosticCategory,
|
clazz: ts.ClassDeclaration, sourceSpan: ParseSourceSpan, category: ts.DiagnosticCategory,
|
||||||
errorCode: ErrorCode, message: string, relatedInformation?: {
|
errorCode: T, message: string, relatedInformation?: {
|
||||||
text: string,
|
text: string,
|
||||||
start: number,
|
start: number,
|
||||||
end: number,
|
end: number,
|
||||||
|
@ -309,9 +309,9 @@ export class TemplateTypeCheckerImpl implements TemplateTypeChecker {
|
|||||||
this.isComplete = false;
|
this.isComplete = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
makeTemplateDiagnostic(
|
makeTemplateDiagnostic<T extends ErrorCode>(
|
||||||
clazz: ts.ClassDeclaration, sourceSpan: ParseSourceSpan, category: ts.DiagnosticCategory,
|
clazz: ts.ClassDeclaration, sourceSpan: ParseSourceSpan, category: ts.DiagnosticCategory,
|
||||||
errorCode: ErrorCode, message: string, relatedInformation?: {
|
errorCode: T, message: string, relatedInformation?: {
|
||||||
text: string,
|
text: string,
|
||||||
start: number,
|
start: number,
|
||||||
end: number,
|
end: number,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user