MCPcopy Index your code
hub / github.com/angular/angular / isWithin

Function isWithin

packages/language-service/src/utils/index.ts:415–427  ·  view source on GitHub ↗
(position: number, span: AbsoluteSourceSpan | ParseSourceSpan)

Source from the content-addressed store, hash-verified

413}
414
415export function isWithin(position: number, span: AbsoluteSourceSpan | ParseSourceSpan): boolean {
416 let start: number, end: number;
417 if (span instanceof ParseSourceSpan) {
418 start = span.start.offset;
419 end = span.end.offset;
420 } else {
421 start = span.start;
422 end = span.end;
423 }
424 // Note both start and end are inclusive because we want to match conditions
425 // like ¦start and end¦ where ¦ is the cursor.
426 return start <= position && position <= end;
427}
428
429/**
430 * For a given location in a shim file, retrieves the corresponding file url for the template and

Callers 11

getTargetAtPositionFunction · 0.90
visitMethod · 0.90
visitMethod · 0.90
isWithinNodeFunction · 0.90
isWithinKeyFunction · 0.85
isWithinKeyValueFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…