Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce a useful ID for a workspace folder #41779

Closed
weinand opened this issue Jan 18, 2018 · 3 comments
Closed

Introduce a useful ID for a workspace folder #41779

weinand opened this issue Jan 18, 2018 · 3 comments
Assignees
Labels
info-needed Issue requires more information from poster under-discussion Issue is under discussion for relevance, priority, approach

Comments

@weinand
Copy link
Contributor

weinand commented Jan 18, 2018

Today a workspace folder is defined by an absolute or relative "path". The path must be unique (but by using symbolic links a workspace can reference the same folder multiple times).
In addition a workspace can have an optional name, but this name is not required to be unique within a workspace.

Neither of these attributes represent a useful ID for referring to a workspace folder in a robust way:

  • the "path" is unique but not stable because if the location of the folder is changed, its ID changes.
  • the "name" is not unique (but probably a bit more stable than the path).

Possible options:

  • introduce a new workspace folder ID that is independent from "name" and "path" (but painful to use),
  • introduce a workspace folder ID based on some combination of "name" and "path" that is unique, stable, and easy to use.

I'd prefer option 2.

@weinand weinand changed the title Introduce a useful ID for a workspace folders Introduce a useful ID for a workspace folder Jan 18, 2018
@bpasero bpasero added feature-request Request for new features or functionality workbench-multiroot Multi-root (multiple folders) issues labels Jan 18, 2018
@bpasero
Copy link
Member

bpasero commented Jan 18, 2018

the "path" is unique but not stable because if the location of the folder is changed, its ID changes.

@weinand I would argue the opposite: the path property is a suitable ID even if the workspace file is moved around because it is used literally.

Best to demonstrate with 2 examples:

{
	"folders": [
		{
			"path": "ticino-playground"
		}
	],
	"launch": {
		"target": ${rootPath:ticino-playground}
	}
}

In this example, the path is a relative one and used in the variable. But it does not matter if the file is moved around because the variable is using the relative value.

{
	"folders": [
		{
			"path": "/User/bpasero/ticino-playground"
		}
	],
	"launch": {
		"target": ${rootPath:/User/bpasero/ticino-playground}
	}
}

In this example the path is absolute and as such it has to be used absolute in the configuration file as well. Again, it does not matter if you move the file around.

@bpasero bpasero added the under-discussion Issue is under discussion for relevance, priority, approach label Jan 18, 2018
@bpasero bpasero removed their assignment Jan 24, 2018
@bpasero bpasero removed feature-request Request for new features or functionality workbench-multiroot Multi-root (multiple folders) issues labels Jan 31, 2018
@bpasero
Copy link
Member

bpasero commented Feb 1, 2018

@weinand ping

@bpasero bpasero added the info-needed Issue requires more information from poster label Feb 1, 2018
@weinand
Copy link
Contributor Author

weinand commented Feb 1, 2018

We are now using the "name" of a folder as its ID (and if this is not unique we bail out).
Closing.

@weinand weinand closed this as completed Feb 1, 2018
@vscodebot vscodebot bot locked and limited conversation to collaborators Mar 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
info-needed Issue requires more information from poster under-discussion Issue is under discussion for relevance, priority, approach
Projects
None yet
Development

No branches or pull requests

2 participants