fix(lsp): ignore editor indent settings if deno.json is present (#26912)

This commit is contained in:
Nayeem Rahman 2024-11-18 21:45:34 +00:00 committed by GitHub
parent 19bbf83e47
commit c36f877f8d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 3 deletions

View File

@ -1396,9 +1396,11 @@ impl Inner {
.fmt_config_for_specifier(&specifier)
.options
.clone();
let config_data = self.config.tree.data_for_specifier(&specifier);
if !config_data.is_some_and(|d| d.maybe_deno_json().is_some()) {
fmt_options.use_tabs = Some(!params.options.insert_spaces);
fmt_options.indent_width = Some(params.options.tab_size as u8);
let config_data = self.config.tree.data_for_specifier(&specifier);
}
let unstable_options = UnstableFmtOptions {
component: config_data
.map(|d| d.unstable.contains("fmt-component"))

View File

@ -11680,7 +11680,7 @@ fn lsp_format_with_config() {
},
"options": {
"tabSize": 2,
"insertSpaces": false
"insertSpaces": true,
}
}),
);