resolve relative paths from workspace/didChangeConfiguration #2372
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
ok admittedly i made the last changes to #2331 without thorough testing.
when I tried to use the feature from #2331 just now, i found out that it wasn't working with the following
.zed/settings.json
i have for my ziglang/zig checkout:(ignore the incorrect
builtin_path
pls)after further debugging, i found 2 issues:
workspace/didChangeConfiguration
notifications. Right now zls only correctly resolves relative paths that are a response toworkspace/configuration
server-side requests (in other words, client messages withi_haz_configuration
id)std.fs.path.join
to resolve the relative paths, ZLS seemed to have some double-accounting of the paths. at some point, I had a log message indicating that both..././src/Builtin.zig
and.../src/Builtin.zig
were being watched by ZLS. which is redundant and presumably a (minor) waste of memorythis PR accounts for both of these issues:
updateConfiguration
method on Serveroptions.resolve_relative_paths
argument is truehandleConfiguration
should be receiving messages with relative configuration paths. As noted above, this is not true - it should also handle relative paths inworkspace/didChangeConfiguration
notifications, which is handled bydidChangeConfigurationHandler
updateConfiguration
sincehandleConfiguration
anddidChangeConfigurationHandler
have different handling of the messagei_haz_configuration
response from the client, it seems Zed is not re-sending the updated relative paths. while theworkspace/configuration
model seems to be the more modern feature, it seems Zed still expectsworkspace/didChangeConfiguration
to handle the initial values from.zed/settings.json
std.fs.path.join
to resolve relative paths, usestd.fs.path.resolve
.