feat: decode Analysis v2 and v3 through a shared statement view
This commit is contained in:
1 parent
58cea75bab
commit
bcd07a43af
13 files changed
+1622
-72
No files matched your search
+2
-12
@@ -82,23 +82,13 @@ impl ProjectInput {
|
||||
)));
|
||||
}
|
||||
for function in &module.functions {
|
||||
function.span.validate(document.source.bytes.len())?;
|
||||
function
|
||||
.heading_span
|
||||
.validate(document.source.bytes.len())?;
|
||||
function.validate_source_spans(&document.source)?;
|
||||
}
|
||||
document.module = Some(module.clone());
|
||||
documents.push(document);
|
||||
}
|
||||
if documents.is_empty() {
|
||||
let module = analysis
|
||||
.modules
|
||||
.iter()
|
||||
.find(|module| module.source_digest == entry_document.source.digest_hex())
|
||||
.cloned();
|
||||
let mut document = entry_document;
|
||||
document.module = module;
|
||||
documents.push(document);
|
||||
documents.push(entry_document);
|
||||
}
|
||||
documents.sort_by(|left, right| left.source.path.cmp(&right.source.path));
|
||||
Ok(Self {
|
||||
|
||||
Reference in new issue
Block a user