Use argument in addition to folderUri when conditionally resolving some variables.#95483
Conversation
7638b15 to
86038cc
Compare
|
Just wanted to note, if the resolution functions are called a lot without a folder root (I assume not), we could gate the try/catch with Also, as I noted in #95482, it seems multi-root workspaces do not pass a |
alexr00
left a comment
There was a problem hiding this comment.
Seems like a good change, just a few modifications!
src/vs/workbench/services/configurationResolver/common/variableResolver.ts
Outdated
Show resolved
Hide resolved
src/vs/workbench/services/configurationResolver/common/variableResolver.ts
Outdated
Show resolved
Hide resolved
|
And thank you for the tests! |
|
Thanks for the quick review! I can rebase and squash once you think it is ready. |
folderUri to gate variable resolving.argument in addition to folderUri when conditionally resolving some variables.
...ch/services/configurationResolver/test/electron-browser/configurationResolverService.test.ts
Outdated
Show resolved
Hide resolved
Some vars were conditionally resolved by first checking `folderUri`. This is wrong, as `getFolderUri()` may return a valid one even when `folderUri` is undefined (when `argument` is used).
5979c37 to
1957a18
Compare
1957a18 to
96be765
Compare
Some variables were conditionally resolved by first checking
folderUri. This is wrong, asgetFolderUri()may return a valid one even whenfolderUriis undefined (whenargumentis used).This PR changes the behavior so that
getFolderUri()is always called, falling back to the original alternative if it fails to find one. By doing this, calls to resolve variables that do not provide afolderUri(aka workspace folder) will still do the right thing when an argument is provided (e.g.${relativeFile:folder}).This PR fixes #95482