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)
| 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 | /// |