mirror of
https://github.com/denoland/deno.git
synced 2025-07-24 05:35:33 +00:00
refactor: upgrade to deno_ast 0.15 (#14680)
This commit is contained in:
parent
e7c894e8f5
commit
1fcecb6789
34 changed files with 365 additions and 314 deletions
|
@ -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,
|
||||
)
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue