Skip to content

Disable autofix by default #1657

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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