Merge pull request #621 from Techatrix/dev

Enable ast-check by default
This commit is contained in:
Auguste Rame 2022-09-03 13:29:58 -04:00 committed by GitHub
commit b842e68697
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 10 additions and 10 deletions

View File

@ -102,7 +102,7 @@ The following options are currently available.
| Option | Type | Default value | What it Does | | Option | Type | Default value | What it Does |
| --- | --- | --- | --- | | --- | --- | --- | --- |
| `enable_snippets` | `bool` | `false` | Enables snippet completions when the client also supports them. | | `enable_snippets` | `bool` | `false` | Enables snippet completions when the client also supports them. |
| `enable_unused_variable_warnings` | `bool` | `false`| Enables warnings for local variables that aren't used. | | `enable_ast_check_diagnostics` | `bool` | `true`| Whether to enable ast-check diagnostics |
| `enable_import_embedfile_argument_completions` | `bool` | `false` | Whether to enable import/embedFile argument completions | | `enable_import_embedfile_argument_completions` | `bool` | `false` | Whether to enable import/embedFile argument completions |
| `zig_lib_path` | `?[]const u8` | `null` | zig library path, e.g. `/path/to/zig/lib/zig`, used to analyze std library imports. | | `zig_lib_path` | `?[]const u8` | `null` | zig library path, e.g. `/path/to/zig/lib/zig`, used to analyze std library imports. |
| `zig_exe_path` | `?[]const u8` | `null` | zig executable path, e.g. `/path/to/zig/zig`, used to run the custom build runner. If `null`, zig is looked up in `PATH`. Will be used to infer the zig standard library path if none is provided. | | `zig_exe_path` | `?[]const u8` | `null` | zig executable path, e.g. `/path/to/zig/zig`, used to run the custom build runner. If `null`, zig is looked up in `PATH`. Will be used to infer the zig standard library path if none is provided. |

View File

@ -12,7 +12,7 @@
"enable_ast_check_diagnostics": { "enable_ast_check_diagnostics": {
"description": "Whether to enable ast-check diagnostics", "description": "Whether to enable ast-check diagnostics",
"type": "boolean", "type": "boolean",
"default": "false" "default": "true"
}, },
"enable_import_embedfile_argument_completions": { "enable_import_embedfile_argument_completions": {
"description": "Whether to enable import/embedFile argument completions", "description": "Whether to enable import/embedFile argument completions",

View File

@ -14,7 +14,7 @@ const logger = std.log.scoped(.config);
enable_snippets: bool = false, enable_snippets: bool = false,
/// Whether to enable ast-check diagnostics /// Whether to enable ast-check diagnostics
enable_ast_check_diagnostics: bool = false, enable_ast_check_diagnostics: bool = true,
/// Whether to enable import/embedFile argument completions (NOTE: these are triggered manually as updating the autotrigger characters may cause issues) /// Whether to enable import/embedFile argument completions (NOTE: these are triggered manually as updating the autotrigger characters may cause issues)
enable_import_embedfile_argument_completions: bool = false, enable_import_embedfile_argument_completions: bool = false,

View File

@ -18,7 +18,13 @@ pub const Context = struct {
var context = Context{ var context = Context{
.server = try Server.init( .server = try Server.init(
allocator, allocator,
.{}, .{
.enable_ast_check_diagnostics = false,
.enable_semantic_tokens = true,
.enable_inlay_hints = true,
.inlay_hints_exclude_single_argument = false,
.inlay_hints_show_builtin = true,
},
null, null,
.debug, .debug,
), ),

View File

@ -71,10 +71,6 @@ fn testInlayHints(source: []const u8) !void {
var ctx = try Context.init(); var ctx = try Context.init();
defer ctx.deinit(); defer ctx.deinit();
ctx.server.config.enable_inlay_hints = true;
ctx.server.config.inlay_hints_exclude_single_argument = false;
ctx.server.config.inlay_hints_show_builtin = true;
const open_document = requests.OpenDocument{ const open_document = requests.OpenDocument{
.params = .{ .params = .{
.textDocument = .{ .textDocument = .{

View File

@ -24,8 +24,6 @@ fn testSemanticTokens(source: []const u8, expected: []const u32) !void {
var ctx = try Context.init(); var ctx = try Context.init();
defer ctx.deinit(); defer ctx.deinit();
ctx.server.config.enable_semantic_tokens = true;
const open_document = requests.OpenDocument{ const open_document = requests.OpenDocument{
.params = .{ .params = .{
.textDocument = .{ .textDocument = .{