Merge pull request #1193 from nullptrdevs/cfg-gen

Update `config_gen` and data
This commit is contained in:
Lee Cannon 2023-05-20 04:10:47 -07:00 committed by GitHub
commit 668d82d440
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 7 deletions

View File

@ -248,12 +248,12 @@ fn generateVSCodeConfigFile(allocator: std.mem.Allocator, config: Config, path:
.type = "string", .type = "string",
.@"enum" = &.{ "off", "messages", "verbose" }, .@"enum" = &.{ "off", "messages", "verbose" },
.description = "Traces the communication between VS Code and the language server.", .description = "Traces the communication between VS Code and the language server.",
.default = .{ .String = "off" }, .default = .{ .string = "off" },
}); });
configuration.putAssumeCapacityNoClobber("zig.zls.checkForUpdate", .{ configuration.putAssumeCapacityNoClobber("zig.zls.checkForUpdate", .{
.type = "boolean", .type = "boolean",
.description = "Whether to automatically check for new updates", .description = "Whether to automatically check for new updates",
.default = .{ .Bool = true }, .default = .{ .bool = true },
}); });
configuration.putAssumeCapacityNoClobber("zig.zls.path", .{ configuration.putAssumeCapacityNoClobber("zig.zls.path", .{
.type = "string", .type = "string",
@ -269,15 +269,15 @@ fn generateVSCodeConfigFile(allocator: std.mem.Allocator, config: Config, path:
errdefer allocator.free(name); errdefer allocator.free(name);
const default: ?std.json.Value = blk: { const default: ?std.json.Value = blk: {
if (option.@"enum" != null) break :blk .{ .String = option.default }; if (option.@"enum" != null) break :blk .{ .string = option.default };
var parser = std.json.Parser.init(allocator, false); var parser = std.json.Parser.init(allocator, .alloc_always);
defer parser.deinit(); defer parser.deinit();
var value = try parser.parse(option.default); var value = try parser.parse(option.default);
defer value.deinit(); defer value.deinit();
break :blk if (value.root != .Null) value.root else null; break :blk if (value.root != .null) value.root else null;
}; };
configuration.putAssumeCapacityNoClobber(name, .{ configuration.putAssumeCapacityNoClobber(name, .{
@ -1051,7 +1051,7 @@ pub fn main() !void {
} }
const config = try std.json.parseFromSlice(Config, gpa, @embedFile("config.json"), .{}); const config = try std.json.parseFromSlice(Config, gpa, @embedFile("config.json"), .{});
defer std.json.parseFree(Config, config, .{}); defer std.json.parseFree(Config, gpa, config);
try generateConfigFile(gpa, config, config_path); try generateConfigFile(gpa, config, config_path);
try generateSchemaFile(gpa, config, schema_path); try generateSchemaFile(gpa, config, schema_path);

View File

@ -1067,7 +1067,7 @@ pub const builtins = [_]Builtin{
\\ \\
\\`dest` must be a mutable slice, a mutable pointer to an array, or a mutable many-item [pointer](https://ziglang.org/documentation/master/#Pointers). It may have any alignment, and it may have any element type. \\`dest` must be a mutable slice, a mutable pointer to an array, or a mutable many-item [pointer](https://ziglang.org/documentation/master/#Pointers). It may have any alignment, and it may have any element type.
\\ \\
\\Likewise, `source` must be a mutable slice, a mutable pointer to an array, or a mutable many-item [pointer](https://ziglang.org/documentation/master/#Pointers). It may have any alignment, and it may have any element type. \\`source` must be a slice, a pointer to an array, or a many-item [pointer](https://ziglang.org/documentation/master/#Pointers). It may have any alignment, and it may have any element type.
\\ \\
\\The `source` element type must support [Type Coercion](https://ziglang.org/documentation/master/#Type-Coercion) into the `dest` element type. The element types may have different ABI size, however, that may incur a performance penalty. \\The `source` element type must support [Type Coercion](https://ziglang.org/documentation/master/#Type-Coercion) into the `dest` element type. The element types may have different ABI size, however, that may incur a performance penalty.
\\ \\