vscode icon indicating copy to clipboard operation
vscode copied to clipboard

Support distinguishing workspace folders based on query param differences

Open isc-bsaviano opened this issue 1 year ago • 7 comments

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: Screenshot 2024-05-09 at 12 31 16 PM

Actual behavior: Screenshot 2024-05-09 at 12 30 51 PM

  • VS Code Version: 1.89.0

See https://github.com/intersystems-community/vscode-objectscript/issues/1358

isc-bsaviano avatar May 09 '24 16:05 isc-bsaviano

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).

isc-bsaviano avatar Jun 20 '24 14:06 isc-bsaviano

@jrieken Is there any chance of this getting fixed for 1.95? Andrea just fixed #227836 which seems to be a similar issue.

isc-bsaviano avatar Oct 21 '24 11:10 isc-bsaviano

Can you share a minimal extension sample for how to get into this state with custom folders based on query params?

bpasero avatar Jan 11 '25 12:01 bpasero

@bpasero Here's how to reproduce the issue using a lightly modified version of the MemFS sample extension:

  1. Download and install the extension attached below.
  2. Open the following workspace:
{
	"folders": [
		{
			"name": "No Query",
			"uri": "memfs:/"
		},
		{
			"name": "Query",
			"uri": "memfs:/?p=1"
		}
	],
	"settings": {}
}
  1. Run the MemFS: Create Files command.
  2. Open any file in the Query folder.
  3. Click on the Query root folder breadcrumb and observe that both root folders have the name Query. The top one should be called No Query.

vscode-memfs-0.0.3.vsix.zip

isc-bsaviano avatar Jan 13 '25 12:01 isc-bsaviano

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 avatar Jan 13 '25 15:01 bpasero

@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.

isc-bsaviano avatar Jan 13 '25 15:01 isc-bsaviano

  • 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.

gjsjohnmurray avatar Jan 15 '25 19:01 gjsjohnmurray