> For the complete documentation index, see [llms.txt](/llms.txt).
> The full corpus is at [llms-full.txt](/llms-full.txt).

# rangeIntersects

> **rangeIntersects**(`snapshot`, `range`, `target`): `boolean`

Defined in: range-intersects.ts:30

Returns true if `range` and the supplied `target` intersect. The target
may be a `Path`, an `EditorSelectionPoint`, or another
`EditorSelection`.

For a `Path` or `EditorSelectionPoint` target, "intersect" means the
target lies at or between `range`'s start and end edges (inclusive).

For an `EditorSelection` target, "intersect" means either endpoint of
`target` lies inside `range`, or `range` strictly encloses `target`.

Pass `snapshot.context.selection` as `range` to ask the question against
the editor's current selection.

Returns `false` when either `range` or `target` is `null`.

## Parameters

### snapshot

`TraversalSnapshot`

### range

`EditorSelection`

### target

`Path` | `EditorSelectionPoint` | `EditorSelection`

## Returns

`boolean`