Build an LSP `Location` with a zero-width range (start == end). Almost every "go to definition" result points to a single position rather than a span. This helper eliminates the repeated 5-line `Location { uri, range: Range { start: pos, end: pos } }` blocks found throughout the definition modules.
(uri: Url, position: Position)
| 61 | /// `Location { uri, range: Range { start: pos, end: pos } }` blocks |
| 62 | /// found throughout the definition modules. |
| 63 | pub(crate) fn point_location(uri: Url, position: Position) -> Location { |
| 64 | Location { |
| 65 | uri, |
| 66 | range: Range { |
| 67 | start: position, |
| 68 | end: position, |
| 69 | }, |
| 70 | } |
| 71 | } |
no outgoing calls
no test coverage detected