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

Test: vscode.workspace.workspaceFile #72494

Closed
2 tasks done
bpasero opened this issue Apr 17, 2019 · 0 comments
Closed
2 tasks done

Test: vscode.workspace.workspaceFile #72494

bpasero opened this issue Apr 17, 2019 · 0 comments

Comments

@bpasero
Copy link
Member

bpasero commented Apr 17, 2019

Refs: #37421

Complexity: 2

There is a new API vscode.workspace.workspaceFile as proposed API:

export namespace workspace {

	/**
	 * The location of the workspace file, for example:
	 *
	 * file:///Users/name/Development/myProject.code-workspace`
	 *
	 * or
	 *
	 * `untitled:1555503116870`
	 *
	 * for a workspace that is untitled and not yet saved.
	 *
	 * Depending on the workspace that is opened, the value will be:
	 *  * `undefined` when no workspace or  a single folder is opened
	 *  * the path of the workspace file as `Uri` otherwise. if the workspace
	 * is untitled, the returned URI will use the `untitled:` scheme
	 *
	 * The location can e.g. be used with the `vscode.openFolder` command to
	 * open the workspace again after it has been closed.
	 *
	 * **Example:**
	 * 
	 * vscode.commands.executeCommand('vscode.openFolder', uriOfWorkspace);
	 * 
	 *
	 * **Note:** it is not advised to use `workspace.workspaceFile` to write
	 * configuration data into the file. You can use `workspace.getConfiguration().update()`
	 * for that purpose which will work both when a single folder is opened as
	 * well as an untitled or saved workspace.
	 */
	export const workspaceFile: Uri | undefined;
}

Verify this API works as advertised.

@bpasero bpasero added this to the April 2019 milestone Apr 17, 2019
@gregvanl gregvanl removed their assignment Apr 20, 2019
@aeschli aeschli assigned alexr00, Tyriar and dbaeumer and unassigned sana-ajani, Tyriar and alexr00 May 6, 2019
@dbaeumer dbaeumer removed their assignment May 7, 2019
@dbaeumer dbaeumer closed this as completed May 7, 2019
@vscodebot vscodebot bot locked and limited conversation to collaborators Jun 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants