MCPcopy Create free account
hub / github.com/PHPantom-dev/phpantom_lsp / point_location

Function point_location

src/definition/mod.rs:63–71  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

61/// `Location { uri, range: Range { start: pos, end: pos } }` blocks
62/// found throughout the definition modules.
63pub(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}

Calls

no outgoing calls

Tested by

no test coverage detected