Function racer::snippet_for_match[][src]

pub fn snippet_for_match(m: &Match, session: &Session<'_>) -> String
Expand description

Returns completion snippets usable by some editors

Generates a snippet string given a Match. The provided snippet contains substrings like “${1:name}” which some editors can use to quickly fill in arguments.

Examples

extern crate racer;

use std::path::Path;

let path = Path::new(".");
let cache = racer::FileCache::default();
let session = racer::Session::new(&cache, Some(path));

let m = racer::complete_fully_qualified_name(
    "std::fs::canonicalize",
    &path,
    &session
).next().unwrap();

let snip = racer::snippet_for_match(&m, &session);
assert_eq!(snip, "canonicalize(${1:path})");