mirror of
https://github.com/denoland/deno.git
synced 2024-11-24 15:19:26 -05:00
fix(lsp): ignore editor indent settings if deno.json is present (#26912)
This commit is contained in:
parent
19bbf83e47
commit
c36f877f8d
2 changed files with 5 additions and 3 deletions
|
@ -1396,9 +1396,11 @@ impl Inner {
|
|||
.fmt_config_for_specifier(&specifier)
|
||||
.options
|
||||
.clone();
|
||||
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);
|
||||
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 unstable_options = UnstableFmtOptions {
|
||||
component: config_data
|
||||
.map(|d| d.unstable.contains("fmt-component"))
|
||||
|
|
|
@ -11680,7 +11680,7 @@ fn lsp_format_with_config() {
|
|||
},
|
||||
"options": {
|
||||
"tabSize": 2,
|
||||
"insertSpaces": false
|
||||
"insertSpaces": true,
|
||||
}
|
||||
}),
|
||||
);
|
||||
|
|
Loading…
Reference in a new issue