MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / get_code

Method get_code

src/context/builder.rs:97–100  ·  view source on GitHub ↗

Reads the source file and extracts the code for a node. Returns `None` if the file cannot be read or the line range is invalid. The `Result` wrapper is preserved for API stability with the previous signature; this method does not currently emit `Err`.

(&self, node: &Node)

Source from the content-addressed store, hash-verified

95 /// The `Result` wrapper is preserved for API stability with the previous
96 /// signature; this method does not currently emit `Err`.
97 pub fn get_code(&self, node: &Node) -> Result<Option<String>> {
98 let mut cache: HashMap<String, Option<String>> = HashMap::new();
99 Ok(self.get_code_cached(node, &mut cache))
100 }
101
102 /// Same as `get_code` but reads each file at most once per `cache`.
103 ///

Calls 1

get_code_cachedMethod · 0.80