Skip to main content

query_methods

Function query_methods 

Source
pub fn query_methods(
    type_name: &str,
    ra_path: &Path,
    deps: Option<&str>,
) -> Result<Vec<Method>>
Expand description

Queries rust-analyzer for all available methods on a given type type expression.

This spins up an ephemeral LSP session, generates a mock workspace via a Probe, triggers a completion request at the appropriate line/column location, and parses the results.

§Environment Variables

  • RUST_METH_DEBUG - If set, logs raw LSP method lifecycle events to standard error.

§Errors

Returns an error if:

  • Spawning the rust-analyzer subprocess fails.
  • The LSP server communication channels break.
  • The server returns an unexpectedly structured or malformed JSON payload.