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

Method handle_with_uri

src/server.rs:1432–1441  ·  view source on GitHub ↗

URI-only handler helper. Like [`handle_with_position`] but for handlers that only need the document URI (no cursor position).

(
        &self,
        handler_name: &str,
        uri: &str,
        f: impl FnOnce(&str) -> Option<T>,
    )

Source from the content-addressed store, hash-verified

1430 /// URI-only handler helper. Like [`handle_with_position`] but for
1431 /// handlers that only need the document URI (no cursor position).
1432 fn handle_with_uri<T>(
1433 &self,
1434 handler_name: &str,
1435 uri: &str,
1436 f: impl FnOnce(&str) -> Option<T>,
1437 ) -> Result<Option<T>> {
1438 Ok(self
1439 .with_file_content(handler_name, uri, None, |content, _| f(content))
1440 .flatten())
1441 }
1442
1443 // ── Initialization helpers ───────────────────────────────────────────
1444

Callers 7

code_actionMethod · 0.80
document_symbolMethod · 0.80
folding_rangeMethod · 0.80
code_lensMethod · 0.80
document_linkMethod · 0.80
selection_rangeMethod · 0.80
semantic_tokens_fullMethod · 0.80

Calls 1

with_file_contentMethod · 0.80

Tested by

no test coverage detected