-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Contributed Task Configuration question #4928
Comments
Thank you for finding the bug and pointing out the root cause ! You are right. the |
@elaihau How about checking only presence of |
I recently experimented adding a |
Yes and No. Could you please give me an example of "detected tasks not having a scope"? Thank you ! |
@elaihau I just tested the described above problem for simple build task: Variable |
@RomanNikitenko and used a different solution to check if a task comes from a Theia extension or plugin: The idea is that, if the Task is contributed / detected / provided by an extension or plugin, the task definition should have been registered and accessible from the However, this solution requires the developer to have the tasks defined either in theia plugin's "taskDefinitions": [
{
"type": "grunt",
"required": [
"task"
],
"properties": {
"task": {
"type": "string",
"description": "%grunt.taskDefinition.type.description%"
},
"file": {
"type": "string",
"description": "%grunt.taskDefinition.file.description%"
}
}
}
] or register programmatically: this.taskDefinitionRegistry.register({
type: CPP_BUILD_TASK_TYPE_KEY,
required: ['label'],
properties: {
label: {
type: 'string',
description: 'Lable of the cpp build configuration task'
}
}
}, CPP_BUILD_TASK_SOURCE); What do you think of it? Any suggestions ? |
@elaihau |
@RomanNikitenko a few other examples of contributing task definition(s) through package.json:
|
@elaihau
Tasks form package.json will be registered automatically as I understand. What we should do with second case? |
in terms of in my opinion there is only one way to provide a 'detected' task, which is using the plugin API you referred to.
again, take the vscode at the same time, it gives the definition of the task from package.json: https://github.com/microsoft/vscode/blob/master/extensions/grunt/package.json#L46 @RomanNikitenko @akosyakov please kindly let me know if i misunderstand the way it works, or miss anything. Thank you ! PS: @RomanNikitenko are you making the task contribution from a place where package.json is unavailable? I am curious what the use case is. |
@elaihau thank you for your answer - I will investigate what we can do for our goals. |
@RomanNikitenko i noticed that the constructor of |
@elaihau |
The issue is relevant for detected tasks, we consider che commands as configured theia tasks, so it’s not relevant for che commands anymore and I'm closing the issue. @elaihau thank you for your help! |
Description
My question is about ContributedTaskConfiguration.
As far as I understand, fields
_source
and_scope
are required to have ability run task as 'provided' (in the new terms - 'detected') task.At the same time field
_scope
can beundefined
according to the doc.For 'detected' tasks with
_scope
=undefined
it works well expect one usecase.After running task at least one time the task is moved to 'recently used tasks' section. Recently used tasks are saved to the storage when an application is stopped and the tasks are restored when an application is started.
The problem is: after starting an application tasks with
_scope
=undefined
don't contain field_scope
anymore, so are handled as 'configured'. As result we get error.I'm looking for way how I can fix this case.
Is it possible to improve way of storage recently used tasks to do not lose fields with
undefined
value? (as we rely just on the presence of the field)If not, should we have some default value instead of
undefined
?Thanks in advance!
Reproduction Steps
_scope
=undefined
@elaihau @akosyakov
The text was updated successfully, but these errors were encountered: