summaryrefslogtreecommitdiff
path: root/cli/lsp/analysis.rs
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2022-04-25 11:23:24 -0400
committerGitHub <noreply@github.com>2022-04-25 11:23:24 -0400
commitc0e3b6096d37e9a4243c7ad461487db291c824fa (patch)
tree83a2cd2c0c002cb84a4f3f1accbc8805daa56701 /cli/lsp/analysis.rs
parent12f7581ed9ee5324a425074d30aedd38b89d4838 (diff)
refactor(lsp): store all the assets in Rust when initializing (#14367)
Diffstat (limited to 'cli/lsp/analysis.rs')
-rw-r--r--cli/lsp/analysis.rs9
1 files changed, 4 insertions, 5 deletions
diff --git a/cli/lsp/analysis.rs b/cli/lsp/analysis.rs
index 2c7079951..bbce1966b 100644
--- a/cli/lsp/analysis.rs
+++ b/cli/lsp/analysis.rs
@@ -323,14 +323,13 @@ fn is_preferred(
/// Convert changes returned from a TypeScript quick fix action into edits
/// for an LSP CodeAction.
-pub async fn ts_changes_to_edit(
+pub fn ts_changes_to_edit(
changes: &[tsc::FileTextChanges],
language_server: &language_server::Inner,
) -> Result<Option<lsp::WorkspaceEdit>, AnyError> {
let mut text_document_edits = Vec::new();
for change in changes {
- let text_document_edit =
- change.to_text_document_edit(language_server).await?;
+ let text_document_edit = change.to_text_document_edit(language_server)?;
text_document_edits.push(text_document_edit);
}
Ok(Some(lsp::WorkspaceEdit {
@@ -539,7 +538,7 @@ impl CodeActionCollection {
}
/// Add a TypeScript code fix action to the code actions collection.
- pub async fn add_ts_fix_action(
+ pub fn add_ts_fix_action(
&mut self,
specifier: &ModuleSpecifier,
action: &tsc::CodeFixAction,
@@ -561,7 +560,7 @@ impl CodeActionCollection {
}
let action =
fix_ts_import_action(specifier, action, &language_server.documents)?;
- let edit = ts_changes_to_edit(&action.changes, language_server).await?;
+ let edit = ts_changes_to_edit(&action.changes, language_server)?;
let code_action = lsp::CodeAction {
title: action.description.clone(),
kind: Some(lsp::CodeActionKind::QUICKFIX),