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

Function toTextSpan

packages/language-service/src/utils/index.ts:60–70  ·  view source on GitHub ↗
(span: AbsoluteSourceSpan | ParseSourceSpan | ParseSpan)

Source from the content-addressed store, hash-verified

58}
59
60export function toTextSpan(span: AbsoluteSourceSpan | ParseSourceSpan | ParseSpan): ts.TextSpan {
61 let start: number, end: number;
62 if (span instanceof AbsoluteSourceSpan || span instanceof ParseSpan) {
63 start = span.start;
64 end = span.end;
65 } else {
66 start = span.start.offset;
67 end = span.end.offset;
68 }
69 return {start, length: end - start};
70}
71
72interface NodeWithKeyAndValue extends TmplAstNode {
73 keySpan: ParseSourceSpan;

Callers 15

visitForLoopBlockMethod · 0.90
visitSwitchBlockMethod · 0.90
visitDeferredBlockMethod · 0.90
visitElementMethod · 0.90
visitComponentMethod · 0.90
visitTemplateMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected