Function generate_ast_vector_data

Source
pub fn generate_ast_vector_data(
    path: PathBuf,
    file_type: Option<&str>,
    grammar_config: &GrammarConfig,
) -> Result<VectorData>
Expand description

Create an AST vector from a path

This returns an AstVector and a pinned struct with the owned data, which the AstVector references.

data is used as an out-parameter. We need some external struct we can reference because the return type references the data in that struct.

This returns an anyhow Result, which is bad practice for a library and will need to be refactored in the future. This method was originally used in the diffsitter binary so we didn’t feel the need to specify a specific error type.