refactor: upgrade to deno_ast 0.15 (#14680)

This commit is contained in:
David Sherret 2022-05-20 16:40:55 -04:00 committed by GitHub
parent e7c894e8f5
commit 1fcecb6789
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
34 changed files with 365 additions and 314 deletions

View file

@ -853,12 +853,11 @@ impl Inner {
params.text_document.language_id, params.text_document.uri
);
}
let content = Arc::new(params.text_document.text);
let document = self.documents.open(
specifier.clone(),
params.text_document.version,
params.text_document.language_id.parse().unwrap(),
content,
params.text_document.text.into(),
);
self.performance.measure(mark);
@ -1106,13 +1105,13 @@ impl Inner {
Some(Err(err)) => Err(anyhow!("{}", err)),
None => {
// it's not a js/ts file, so attempt to format its contents
format_file(&file_path, document.content().as_str(), &fmt_options)
format_file(&file_path, &document.content(), &fmt_options)
}
};
match format_result {
Ok(Some(new_text)) => Some(text::get_edits(
document.content().as_str(),
&document.content(),
&new_text,
document.line_index().as_ref(),
)),
@ -1931,7 +1930,7 @@ impl Inner {
.map(|span| {
span.to_folding_range(
asset_or_doc.line_index(),
asset_or_doc.text().as_str().as_bytes(),
asset_or_doc.text().as_bytes(),
self.config.client_capabilities.line_folding_only,
)
})