Support distinguishing workspace folders based on query param differences
When using a multi-root workspace that has folders whose URIs differ only in query parameters, the sibling folders shown via breadcrumb select have the wrong names. When expanded, the folder contents are correct. Consider the following workspace:
{
"folders": [
{
"name": "abc",
"uri": "isfs://iris:user/"
},
{
"name": "def",
"uri": "isfs://iris:user/?csp"
}
]
}
Expected behavior:
Actual behavior:
- VS Code Version: 1.89.0
See https://github.com/intersystems-community/vscode-objectscript/issues/1358
Hi @jrieken, can you please review John's PR? It would be great to have this fixed in the same version as a related issue that was already fixed (#214329).
@jrieken Is there any chance of this getting fixed for 1.95? Andrea just fixed #227836 which seems to be a similar issue.
Can you share a minimal extension sample for how to get into this state with custom folders based on query params?
@bpasero Here's how to reproduce the issue using a lightly modified version of the MemFS sample extension:
- Download and install the extension attached below.
- Open the following workspace:
{
"folders": [
{
"name": "No Query",
"uri": "memfs:/"
},
{
"name": "Query",
"uri": "memfs:/?p=1"
}
],
"settings": {}
}
- Run the
MemFS: Create Filescommand. - Open any file in the
Queryfolder. - Click on the
Queryroot folder breadcrumb and observe that both root folders have the nameQuery. The top one should be calledNo Query.
Thank you for the steps, I can confirm! But I disagree this is a problem specific to breadcrumbs. In more general, we are not supporting workspace folders well that only differ in query parameters. Here are more examples where we do NOT support them:
- window title variable
${folderName} - editor picker
- file explorer auto selecting the "wrong" file when navigating between editors
- probably a lot more from the references at https://github.com/microsoft/vscode/pull/212436#issuecomment-2585254376
Hence I am going to rename this issue and treat it as feature, because this is something we would have to bring into each component and support it either everywhere or not at all.
@bpasero Thanks for following the steps! I hope this can get worked on soon as it's very important for our extensions. We use the different query parameters to filter the documents on the remote servers that get shown in the VS Code virtual file system.
window title variable
${folderName}editor picker
file explorer auto selecting the "wrong" file when navigating between editors
A quick test of PR #237987 with the VSIX from @isc-bsaviano indicates it has fixed these three.