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

Cannot provide configured task for 'typescript' #9382

Open
Tracked by #13192
tsmaeder opened this issue Apr 21, 2021 · 3 comments
Open
Tracked by #13192

Cannot provide configured task for 'typescript' #9382

tsmaeder opened this issue Apr 21, 2021 · 3 comments
Assignees
Labels
bug bugs found in the application tasks issues related to the task system

Comments

@tsmaeder
Copy link
Contributor

tsmaeder commented Apr 21, 2021

Bug Description

In VS Code, I can configure a task of type 'typescript' that is not considered "customizing" a provided task. That task is considered a new task and shows up when running tasks.

Steps to Reproduce:

  1. In a workspace containing Theia source, invoke "Configure Task"
  2. Select the task "tsc: build - tsconfig.json"
  3. Observe: the tasks.json file is opened and the task added to it.
  4. Change the field tsconfig to ${workspaceFolder}/gurkensalat/tsconfig.json
  5. Change the field label to Gurkensalat
  6. Invoke "Run Task"
  7. Observe: "Gurkensalat" does not show up as a task

Note that I can see and run the task in VS Code.

Additional Information

  • Operating System:
  • Theia Version:
@tsmaeder tsmaeder added tasks issues related to the task system bug bugs found in the application labels Apr 21, 2021
@colin-grant-work
Copy link
Contributor

I have encountered a similar problem. At least involved is this code:

if (this.isDetectedTask(transformedTask)) {
addCustomization(scopeKey, transformedTask);
} else {
addConfiguredTask(scopeKey, transformedTask['label'] as string, transformedTask);
}

Here, any task whose type is in the TaskDefinitionRegistry is treated as a customization, rather than a configuration.

@sgraband
Copy link
Contributor

I can take a look!

@sgraband
Copy link
Contributor

After some investigation i found out that the task will no longer show up when running Run Task..., because it is filtered out here.
Basically we try to match a Customized Task to an existing Contributed Task by checking that all of the relevant fields match, e.g. the tsconfig field (Note: The label is not part of this matching). If one of the fields does not match we filter out the task and therefore making it not runnable.

In VSCode this works differently. The task will still show up, even if one of the fields is changed.
This could either be done, by changing the matching to something id-based, or by copying the information of the task, instead of tying to match it to an existing task. However, it needs to be clarified what effect this would have on the task system.

Another thing i noticed is, that potential arguments of Customized Task might not be overriden so that the original task would still be executed, even if some of the fields would have been changed. This can also be seen, by debugging this line.

Also posting this link here to highlight that there seem to be more problems with the task system. So maybe a bigger overhaul would be a good idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug bugs found in the application tasks issues related to the task system
Projects
None yet
Development

No branches or pull requests

3 participants