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

Implement workspace.workspaceFile extension API #9132

Merged
merged 1 commit into from
Mar 3, 2021

Conversation

alvsan09
Copy link
Contributor

@alvsan09 alvsan09 commented Feb 26, 2021

This first implementation returns the Uri location of the workspace
file even if it is untitled (i.e. saved on a temporary default
location).

Fixes: #8994

Signed-off-by: Alvaro Sanchez-Leon [email protected]

What it does

Introduces support for the plugin API: 'vscode.workspace.workspaceFile'

How to test

An test plugin that calls this API is available from: plugin

Once installed issue the command: "Test: Echo Workspace"

  1. Try the command in multi-root projects and make sure a Uri with the proper location of the workspace file is returned
  2. Try the command in a project not using multi-roots and verify that no Uri is provided.
  3. Open a project directory and use "Save workspace as" to convert it to a multi-root, try the command and verify it Uri is provided.

Review checklist

Reminder for reviewers

@vince-fugnitto vince-fugnitto added the vscode issues related to VSCode compatibility label Feb 26, 2021
This first implementation returns the Uri location of the workspace
file even if it is untitled (i.e. saved on a temporary default
location).

Issue: eclipse-theia#8994

Signed-off-by: Alvaro Sanchez-Leon <[email protected]>
@alvsan09
Copy link
Contributor Author

alvsan09 commented Mar 2, 2021

The recent commit adds a new event (onWorkspaceLocationChanged) in order to get notifications for the action "Save as" applied to a work space.

@vince-fugnitto vince-fugnitto added the workspace issues related to the workspace label Mar 2, 2021
Copy link
Member

@vince-fugnitto vince-fugnitto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I verified the changes and they work well 👍

I verified the following conditions:

Use-Case Result
No Workspace The API correctly returns undefined
Non Multi-Root Workspace The API correctly returns undefined
Unsaved Multi-Root Workspace The API correctly returns the URI of the temporary workspace file location (untitled)
Saved Multi-Root Workspace The API correctly returns the URI of the saved workspace file location

@alvsan09
Copy link
Contributor Author

alvsan09 commented Mar 3, 2021

Hi @kittaakos,
The latest commit addresses your comments, please let me know in case there are any more items to clarify.
Regards

Copy link
Contributor

@kittaakos kittaakos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the patch, @alvsan09 👍

@vince-fugnitto vince-fugnitto merged commit 308a6f7 into eclipse-theia:master Mar 3, 2021
@vince-fugnitto vince-fugnitto added this to the 1.12.0 milestone Mar 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
vscode issues related to VSCode compatibility workspace issues related to the workspace
Projects
None yet
Development

Successfully merging this pull request may close these issues.

vscode.workspace.workspaceFile returns undefined
3 participants