We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1c526f6 commit ec42ffdCopy full SHA for ec42ffd
crates/ark/src/lsp/folding_range.rs
@@ -19,14 +19,7 @@ use crate::lsp::documents::Document;
19
pub fn folding_range(document: &Document) -> anyhow::Result<Vec<FoldingRange>> {
20
let mut folding_ranges: Vec<FoldingRange> = Vec::new();
21
22
- // Activate the parser
23
- let mut parser = tree_sitter::Parser::new();
24
- parser
25
- .set_language(&tree_sitter_r::LANGUAGE.into())
26
- .unwrap();
27
-
28
- let ast = parser.parse(&document.contents.to_string(), None).unwrap();
29
+ let ast = &document.ast;
30
if ast.root_node().has_error() {
31
tracing::error!("Folding range service: Parse error");
32
return Err(anyhow::anyhow!("Parse error"));
0 commit comments