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

[task]: Update TaskConfigurationManager on Workspace Location Change #9331

Conversation

colin-grant-work
Copy link
Contributor

@colin-grant-work colin-grant-work commented Apr 12, 2021

Signed-off-by: Colin Grant colin.grant@ericsson.com

What it does

Fixes #9329 by adding a listener for onLocationChanged to the TaskConfigurationManager to ensure that it updates the target of its workspace proxy when a workspace file is created.

In addition, it fires a changed event when the workspace proxy is changed, parallel to the events fired when new folder-scope models are created.

How to test

  1. Checkout this PR branch.
  2. Cherry pick the commit from this branch to add a command to log what the configuration service lists in workspace scope. (ctrl+p, search 'Check tasks listed in workspace scope.')
  3. Open a single-root, unsaved workspace.
  4. If there are no tasks in the root, add one, e.g.
{
  "version": "2.0.0",
  "tasks": [
    {"label": "Folder task", "type": "shell", "command": "htop"}
  ]
}
  1. Run the command to log tasks in workspace scope.
  2. See that the tasks in the folder scope are logged (since folder scope = workspace scope)
  3. Run File > Save Workspace as ... and save the workspace wherever you'd like.
  4. Run the command to log tasks in workspace scope.
  5. See that the tasks in folder scope are not logged, since folder scope != workspace scope after saving the workspace file.

Review checklist

Reminder for reviewers

@colin-grant-work colin-grant-work added the tasks issues related to the task system label Apr 12, 2021
@colin-grant-work colin-grant-work changed the title update workspace model on location change [task]: Update TaskConfigurationManager on Workspace Location Change Apr 12, 2021
Signed-off-by: Colin Grant <colin.grant@ericsson.com>
Copy link
Contributor

@kenneth-marut-work kenneth-marut-work left a comment

Choose a reason for hiding this comment

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

Tested and working 👍

@kenneth-marut-work kenneth-marut-work merged commit f438a1e into eclipse-theia:master Apr 20, 2021
@colin-grant-work colin-grant-work deleted the bugfix/update-on-location-change branch April 20, 2021 18:31
@vince-fugnitto vince-fugnitto added this to the 1.13.0 milestone Apr 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tasks issues related to the task system
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Workspace Model Not Updated onWorkspaceLocationChanged
3 participants