summaryrefslogtreecommitdiff
path: root/cli/lsp/language_server.rs
diff options
context:
space:
mode:
Diffstat (limited to 'cli/lsp/language_server.rs')
-rw-r--r--cli/lsp/language_server.rs11
1 files changed, 10 insertions, 1 deletions
diff --git a/cli/lsp/language_server.rs b/cli/lsp/language_server.rs
index 95bdf8724..0b6051212 100644
--- a/cli/lsp/language_server.rs
+++ b/cli/lsp/language_server.rs
@@ -38,6 +38,7 @@ use super::analysis::fix_ts_import_changes;
use super::analysis::ts_changes_to_edit;
use super::analysis::CodeActionCollection;
use super::analysis::CodeActionData;
+use super::analysis::TsResponseImportMapper;
use super::cache;
use super::capabilities;
use super::client::Client;
@@ -2029,7 +2030,7 @@ impl Inner {
fix_ts_import_changes(
&code_action_data.specifier,
&combined_code_actions.changes,
- &self.documents,
+ &self.get_ts_response_import_mapper(),
)
.map_err(|err| {
error!("Unable to remap changes: {}", err);
@@ -2081,6 +2082,14 @@ impl Inner {
Ok(result)
}
+ pub fn get_ts_response_import_mapper(&self) -> TsResponseImportMapper {
+ TsResponseImportMapper::new(
+ &self.documents,
+ &self.npm.resolution,
+ &self.npm.resolver,
+ )
+ }
+
async fn code_lens(
&self,
params: CodeLensParams,