Fix NautilusContext::from_file for python files (#2690)

This commit is contained in:
jejuisland87654 2024-11-13 20:45:18 +01:00 committed by GitHub
parent b7889a5996
commit 8d81e3480e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -89,9 +89,10 @@ impl NautilusContext {
let grammar_file = grammar_file.as_ref();
if grammar_file.extension().unwrap_or_default() == "py" {
log::debug!("Creating NautilusContext from python grammar");
let ctx = python_grammar_loader::load_python_grammar(
let mut ctx = python_grammar_loader::load_python_grammar(
fs::read_to_string(grammar_file)?.as_str(),
);
ctx.initialize(tree_depth);
return Ok(Self { ctx });
}
log::debug!("Creating NautilusContext from json grammar");