diff options
author | Nayeem Rahman <nayeemrmn99@gmail.com> | 2024-10-25 18:35:09 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-25 18:35:09 +0100 |
commit | 38c7af456518ac4fdbd36e3bfa731c38195bb773 (patch) | |
tree | 363228814b1b43cda6252e1adabdcf24e3989bb7 /cli/lsp/tsc.rs | |
parent | 730331622ee17cf603447f4eb53631b9cfd7bef1 (diff) |
feat(lsp): "typescript.preferences.preferTypeOnlyAutoImports" setting (#26546)
Diffstat (limited to 'cli/lsp/tsc.rs')
-rw-r--r-- | cli/lsp/tsc.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/cli/lsp/tsc.rs b/cli/lsp/tsc.rs index 0bc7d1600..0f31d7dd3 100644 --- a/cli/lsp/tsc.rs +++ b/cli/lsp/tsc.rs @@ -4952,6 +4952,8 @@ pub struct UserPreferences { pub auto_import_file_exclude_patterns: Option<Vec<String>>, #[serde(skip_serializing_if = "Option::is_none")] pub interactive_inlay_hints: Option<bool>, + #[serde(skip_serializing_if = "Option::is_none")] + pub prefer_type_only_auto_imports: Option<bool>, } impl UserPreferences { @@ -5074,6 +5076,9 @@ impl UserPreferences { } else { Some(language_settings.preferences.quote_style) }, + prefer_type_only_auto_imports: Some( + language_settings.preferences.prefer_type_only_auto_imports, + ), ..base_preferences } } @@ -6215,7 +6220,7 @@ mod tests { let change = changes.text_changes.first().unwrap(); assert_eq!( change.new_text, - "import type { someLongVariable } from './b.ts'\n" + "import { someLongVariable } from './b.ts'\n" ); } |