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.rs29
1 files changed, 27 insertions, 2 deletions
diff --git a/cli/lsp/language_server.rs b/cli/lsp/language_server.rs
index df5552764..102408df4 100644
--- a/cli/lsp/language_server.rs
+++ b/cli/lsp/language_server.rs
@@ -1927,6 +1927,10 @@ impl Inner {
..line_index.offset_tsc(diagnostic.range.end)?,
codes,
(&self.fmt_options.options).into(),
+ tsc::UserPreferences {
+ quote_preference: Some((&self.fmt_options.options).into()),
+ ..self.config.workspace_settings().into()
+ },
)
.await;
for action in actions {
@@ -1984,6 +1988,10 @@ impl Inner {
specifier.clone(),
line_index.offset_tsc(params.range.start)?
..line_index.offset_tsc(params.range.end)?,
+ Some(tsc::UserPreferences {
+ quote_preference: Some((&self.fmt_options.options).into()),
+ ..self.config.workspace_settings().into()
+ }),
only,
)
.await?;
@@ -2039,6 +2047,10 @@ impl Inner {
self.snapshot(),
&code_action_data,
(&self.fmt_options.options).into(),
+ tsc::UserPreferences {
+ quote_preference: Some((&self.fmt_options.options).into()),
+ ..self.config.workspace_settings().into()
+ },
)
.await?;
if combined_code_actions.commands.is_some() {
@@ -2084,6 +2096,10 @@ impl Inner {
..line_index.offset_tsc(action_data.range.end)?,
action_data.refactor_name,
action_data.action_name,
+ Some(tsc::UserPreferences {
+ quote_preference: Some((&self.fmt_options.options).into()),
+ ..self.config.workspace_settings().into()
+ }),
)
.await?;
code_action.edit = refactor_edit_info.to_workspace_edit(self).await?;
@@ -2399,6 +2415,7 @@ impl Inner {
position,
tsc::GetCompletionsAtPositionOptions {
user_preferences: tsc::UserPreferences {
+ quote_preference: Some((&self.fmt_options.options).into()),
allow_incomplete_completions: Some(true),
allow_text_changes_in_new_files: Some(
specifier.scheme() == "file",
@@ -2466,10 +2483,14 @@ impl Inner {
})?;
if let Some(data) = &data.tsc {
let specifier = &data.specifier;
- let args = GetCompletionDetailsArgs {
+ let mut args = GetCompletionDetailsArgs {
format_code_settings: Some((&self.fmt_options.options).into()),
..data.into()
};
+ args
+ .preferences
+ .get_or_insert(Default::default())
+ .quote_preference = Some((&self.fmt_options.options).into());
let result = self
.ts_server
.get_completion_details(self.snapshot(), args)
@@ -2971,6 +2992,7 @@ impl Inner {
(&self.fmt_options.options).into(),
tsc::UserPreferences {
allow_text_changes_in_new_files: Some(true),
+ quote_preference: Some((&self.fmt_options.options).into()),
..Default::default()
},
)
@@ -3600,7 +3622,10 @@ impl Inner {
self.snapshot(),
specifier,
text_span,
- workspace_settings.into(),
+ tsc::UserPreferences {
+ quote_preference: Some((&self.fmt_options.options).into()),
+ ..workspace_settings.into()
+ },
)
.await?;
let maybe_inlay_hints = maybe_inlay_hints.map(|hints| {