-
-
Notifications
You must be signed in to change notification settings - Fork 304
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
rework config system #1366
rework config system #1366
Conversation
0618097
to
92e1137
Compare
if (!std.fs.path.isAbsolute(path)) { | ||
server.showMessage(.Warning, "config option '{s}': expected absolute path but got '{s}'", .{ field_name, path }); | ||
break :ok false; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using "zig" as the zig path in order to use the zig in the PATH
causes this check to fail, even though that works perfectly fine.
Other than that minor annoyance this PR looks good.
log.info("Using offset encoding: {s}", .{@tagName(server.offset_encoding)}); | ||
log.info("offset encoding: {s}", .{@tagName(server.offset_encoding)}); | ||
|
||
server.updateConfiguration(.{}) catch |err| { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would seem that the .{}
param here invalidates some of the zls.json
settings?
Causes try server.resolveConfiguration(config_arena, &new_cfg);
to reevaluate the corresponding ?const []u8
s as if they haven't been set.
[Trace - 2:49:05 PM] Sending request 'initialize - (0)'.
info : ( main ): Enabled debug logging.
info : ( main ): Starting ZLS 0.12.0-dev.17+4c3236b @ '/home/rad/lab/zls/npdm/zig-out/bin/zls'
info : (server): set config option 'semantic_tokens' to 'Config.Config__enum_5911.none' // Custom
info : (server): set config option 'warn_style' to 'true' // Custom
info : (server): set config option 'highlight_global_var_declarations' to 'true' // Custom
info : (server): set config option 'skip_std_references' to 'true' // Custom
info : (server): set config option 'prefer_ast_check_as_child_process' to 'false' // Custom
info : (server): set config option 'builtin_path' to '/home/rad/.cache/zls/builtin.zig' // Auto
info : (server): set config option 'zig_lib_path' to '/home/rad/lab/zig/build/stage3/lib/zig' // Auto
info : (server): set config option 'zig_exe_path' to '/home/rad/lab/zig/build/stage3/bin/zig' // Custom
info : (server): set config option 'build_runner_path' to '/home/rad/.cache/zls/build_runner.zig' // Auto
info : (server): set config option 'global_cache_path' to '/home/rad/.cache/zls' // Auto
info : (server): set config option 'build_runner_global_cache_path' to '/home/rad/.cache/zig' // Auto
info : (server): client is 'VSCodium-1.81.0'
info : (server): Server.ClientCapabilities{ .supports_snippets = true, .supports_apply_edits = true, .supports_will_save = true, .supports_will_save_wait_until = true, .supports_publish_diagnostics = true, .supports_code_action_fixall = false, .hover_supports_md = true, .completion_doc_supports_md = true, .label_details_support = true, .supports_configuration = true, .supports_workspace_did_change_configuration_dynamic_registration = true, .supports_textDocument_definition_linkSupport = true }
info : (server): offset encoding: utf-16
info : (server): set config option 'zig_lib_path' to '/home/rad/lab/zig/lib' // Auto
info : (server): set config option 'zig_exe_path' to '/home/rad/lab/zig/build/stage4/bin/zig' // Auto from PATH
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does #1404 resolve your issue?
Since configuration can be very sensible to changes it may be better to hold these changes back until after the 0.11.0 release.These changes move some of the configuration setup into the initialize request which allows sending messages about bad config options that show up in the user interface (in VS-Code at least).
fixes #1251
fixes #1238
fixes #1129
fixes #994
fixes #1104