Skip to content

Commit 6ec8fc8

Browse files
SuperAugusteTechatrix
authored andcommitted
Disable autofix by default (#1657)
1 parent 1264b19 commit 6ec8fc8

File tree

5 files changed

+5
-4
lines changed

5 files changed

+5
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ The following options are currently available.
6060
| `enable_argument_placeholders` | `bool` | `true` | Whether to enable function argument placeholder completions |
6161
| `enable_ast_check_diagnostics` | `bool` | `true` | Whether to enable ast-check diagnostics |
6262
| `enable_build_on_save` | `bool` | `false` | Whether to enable build-on-save diagnostics |
63-
| `enable_autofix` | `bool` | `true` | Whether to automatically fix errors on save. Currently supports adding and removing discards. |
63+
| `enable_autofix` | `bool` | `false` | Whether to automatically fix errors on save. Currently supports adding and removing discards. |
6464
| `semantic_tokens` | `enum` | `.full` | Set level of semantic tokens. Partial only includes information that requires semantic analysis. |
6565
| `enable_inlay_hints` | `bool` | `true` | Enables inlay hint support when the client also supports it |
6666
| `inlay_hints_show_variable_type_hints` | `bool` | `true` | Enable inlay hints for variable types |

schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"enable_autofix": {
2828
"description": "Whether to automatically fix errors on save. Currently supports adding and removing discards.",
2929
"type": "boolean",
30-
"default": "true"
30+
"default": "false"
3131
},
3232
"semantic_tokens": {
3333
"description": "Set level of semantic tokens. Partial only includes information that requires semantic analysis.",

src/Config.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ enable_ast_check_diagnostics: bool = true,
1717
enable_build_on_save: bool = false,
1818

1919
/// Whether to automatically fix errors on save. Currently supports adding and removing discards.
20-
enable_autofix: bool = true,
20+
enable_autofix: bool = false,
2121

2222
/// Set level of semantic tokens. Partial only includes information that requires semantic analysis.
2323
semantic_tokens: enum {

src/config_gen/config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"name": "enable_autofix",
2929
"description": "Whether to automatically fix errors on save. Currently supports adding and removing discards.",
3030
"type": "bool",
31-
"default": "true"
31+
"default": "false"
3232
},
3333
{
3434
"name": "semantic_tokens",

tests/lsp_features/code_actions.zig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,7 @@ fn testAutofix(before: []const u8, after: []const u8) !void {
260260
fn testAutofixOptions(before: []const u8, after: []const u8, want_zir: bool) !void {
261261
var ctx = try Context.init();
262262
defer ctx.deinit();
263+
ctx.server.config.enable_autofix = true;
263264
ctx.server.config.enable_ast_check_diagnostics = true;
264265
ctx.server.config.prefer_ast_check_as_child_process = !want_zir;
265266

0 commit comments

Comments
 (0)