From f3fe901cebddc726f94233b7201e87185f9fd3d5 Mon Sep 17 00:00:00 2001 From: SuperAuguste <19855629+SuperAuguste@users.noreply.github.com> Date: Fri, 8 Dec 2023 17:07:36 -0500 Subject: [PATCH] Disable autofix by default --- README.md | 2 +- schema.json | 2 +- src/Config.zig | 2 +- src/config_gen/config.json | 2 +- tests/lsp_features/code_actions.zig | 1 + 5 files changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 5caed10b7..5d3bd62b4 100644 --- a/README.md +++ b/README.md @@ -60,7 +60,7 @@ The following options are currently available. | `enable_argument_placeholders` | `bool` | `true` | Whether to enable function argument placeholder completions | | `enable_ast_check_diagnostics` | `bool` | `true` | Whether to enable ast-check diagnostics | | `enable_build_on_save` | `bool` | `false` | Whether to enable build-on-save diagnostics | -| `enable_autofix` | `bool` | `true` | Whether to automatically fix errors on save. Currently supports adding and removing discards. | +| `enable_autofix` | `bool` | `false` | Whether to automatically fix errors on save. Currently supports adding and removing discards. | | `semantic_tokens` | `enum` | `.full` | Set level of semantic tokens. Partial only includes information that requires semantic analysis. | | `enable_inlay_hints` | `bool` | `true` | Enables inlay hint support when the client also supports it | | `inlay_hints_show_variable_type_hints` | `bool` | `true` | Enable inlay hints for variable types | diff --git a/schema.json b/schema.json index 2efbdafb8..b34cdbadd 100644 --- a/schema.json +++ b/schema.json @@ -27,7 +27,7 @@ "enable_autofix": { "description": "Whether to automatically fix errors on save. Currently supports adding and removing discards.", "type": "boolean", - "default": "true" + "default": "false" }, "semantic_tokens": { "description": "Set level of semantic tokens. Partial only includes information that requires semantic analysis.", diff --git a/src/Config.zig b/src/Config.zig index 6bb006505..06837f0de 100644 --- a/src/Config.zig +++ b/src/Config.zig @@ -17,7 +17,7 @@ enable_ast_check_diagnostics: bool = true, enable_build_on_save: bool = false, /// Whether to automatically fix errors on save. Currently supports adding and removing discards. -enable_autofix: bool = true, +enable_autofix: bool = false, /// Set level of semantic tokens. Partial only includes information that requires semantic analysis. semantic_tokens: enum { diff --git a/src/config_gen/config.json b/src/config_gen/config.json index bb6b1e970..405114122 100644 --- a/src/config_gen/config.json +++ b/src/config_gen/config.json @@ -28,7 +28,7 @@ "name": "enable_autofix", "description": "Whether to automatically fix errors on save. Currently supports adding and removing discards.", "type": "bool", - "default": "true" + "default": "false" }, { "name": "semantic_tokens", diff --git a/tests/lsp_features/code_actions.zig b/tests/lsp_features/code_actions.zig index 9ffe3b038..a6508cede 100644 --- a/tests/lsp_features/code_actions.zig +++ b/tests/lsp_features/code_actions.zig @@ -193,6 +193,7 @@ fn testAutofix(before: []const u8, after: []const u8) !void { fn testAutofixOptions(before: []const u8, after: []const u8, want_zir: bool) !void { var ctx = try Context.init(); defer ctx.deinit(); + ctx.server.config.enable_autofix = true; ctx.server.config.enable_ast_check_diagnostics = true; ctx.server.config.prefer_ast_check_as_child_process = !want_zir;