MCPcopy Create free account
hub / github.com/angular/angular / makeDiagnostic

Function makeDiagnostic

packages/compiler-cli/src/ngtsc/diagnostics/src/error.ts:48–65  ·  view source on GitHub ↗
(
  code: ErrorCode,
  node: ts.Node,
  messageText: string | ts.DiagnosticMessageChain,
  relatedInformation?: ts.DiagnosticRelatedInformation[],
  category: ts.DiagnosticCategory = ts.DiagnosticCategory.Error,
)

Source from the content-addressed store, hash-verified

46}
47
48export function makeDiagnostic(
49 code: ErrorCode,
50 node: ts.Node,
51 messageText: string | ts.DiagnosticMessageChain,
52 relatedInformation?: ts.DiagnosticRelatedInformation[],
53 category: ts.DiagnosticCategory = ts.DiagnosticCategory.Error,
54): ts.DiagnosticWithLocation {
55 node = ts.getOriginalNode(node);
56 return {
57 category,
58 code: ngErrorCode(code),
59 file: ts.getOriginalNode(node).getSourceFile(),
60 start: node.getStart(undefined, false),
61 length: node.getWidth(),
62 messageText,
63 relatedInformation,
64 };
65}
66
67export function makeDiagnosticChain(
68 messageText: string,

Callers 15

checkNodeMethod · 0.90
checkNodeMethod · 0.90
getExportedScopeMethod · 0.90
invalidRefFunction · 0.90
invalidReexportFunction · 0.90
reexportCollisionFunction · 0.90

Calls 2

ngErrorCodeFunction · 0.90
getSourceFileMethod · 0.45

Tested by

no test coverage detected