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.jsoni have for my ziglang/zig checkout:(ignore the incorrect
builtin_pathpls)after further debugging, i found 2 issues:
workspace/didChangeConfigurationnotifications. Right now zls only correctly resolves relative paths that are a response toworkspace/configurationserver-side requests (in other words, client messages withi_haz_configurationid)std.fs.path.jointo 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.zigand.../src/Builtin.zigwere being watched by ZLS. which is redundant and presumably a (minor) waste of memorythis PR accounts for both of these issues:
updateConfigurationmethod on Serveroptions.resolve_relative_pathsargument is truehandleConfigurationshould be receiving messages with relative configuration paths. As noted above, this is not true - it should also handle relative paths inworkspace/didChangeConfigurationnotifications, which is handled bydidChangeConfigurationHandlerupdateConfigurationsincehandleConfigurationanddidChangeConfigurationHandlerhave different handling of the messagei_haz_configurationresponse from the client, it seems Zed is not re-sending the updated relative paths. while theworkspace/configurationmodel seems to be the more modern feature, it seems Zed still expectsworkspace/didChangeConfigurationto handle the initial values from.zed/settings.jsonstd.fs.path.jointo resolve relative paths, usestd.fs.path.resolve.