Skip to content

Commit

Permalink
Disable autofix by default (#1657)
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperAuguste authored Dec 14, 2023
1 parent d1ad449 commit 9476a1d
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down
2 changes: 1 addition & 1 deletion schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
Expand Down
2 changes: 1 addition & 1 deletion src/Config.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion src/config_gen/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions tests/lsp_features/code_actions.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 9476a1d

Please sign in to comment.