-
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
users shouldn't have the flexibility of customizing all properties of a detected task #5679
Comments
@RomanNikitenko @azatsarynnyy |
@elaihau Our tasks contain fields with info about command, working directory, container where a task will be executed and so on. It's really important for us to provide the flexibility of customizing a configuration! On the other hand I understand that at the moment the customizing of detected tasks in Theia differs from VS Code behavior and an configuration after customizing contain extra fields. Could you provide more info about the way how you are going to achieve the alignment? To help me understand how we can adapt our code, let us suppose, at the start of a workspace our tasks with all required fields are copied to tasks.json file without user interaction. Thanks in advance! |
To make myself clear, I want to define what "customize" means to me first. With my definion of "customize" in mind, only detected tasks can be customized. Therefore, I don't think the process of customizing / updating / adding / removing configured tasks will be changed.
The code that runs configured tasks will NOT be touched at all. Running detected tasks, if aligned with VS Code, should work this way in Theia: The four-step process described above is just a proposal. I understand there could be a reason behind "offering flexibility to customize all task properties". And it is why I would like to hear opinions & suggestions from the community before writing code :) |
Roman, if possible, could you please give me an example where users need to customize properties such as |
@elaihau
I think users don't have needs to customize
Yes, I understand and agree with you. But in VS Code terms what's the best way for user to add a new task? Not override some task, just add a new task. We provided our tasks using plugin API (so, as As an example of
You can see that After align with VS Code behavior - what will happen if user runs a configuration from We register own runner for Thank you! |
@RomanNikitenko
maybe what I can do is,
Take your che task for example, {
"type": "che",
"label": "run che-theia + container-plugin",
"command": "kill `cat /tmp/node_theiadev.pid`; rm /default-theia-plugins/eclipse_che_theia_containers_plugin.theia; mkdir -p /tmp/theiadev_projects && export CHE_PROJECTS_ROOT=/tmp/theiadev_projects && export HOSTED_PLUGIN=/projects/che-theia/plugins/containers-plugin/ && node src-gen/backend/main.js /tmp/theiadev_projects --hostname=0.0.0.0 --port=3130 & echo $!> /tmp/node_theiadev.pid ; wait `cat /tmp/node_theiadev.pid`\n",
"target": {
"workingDir": "/projects/theia/production",
"containerName": "che-dev"
}
} It is contributed by a Theia plugin so it will be displayed as a detected task at the beginning. {
"type": "che",
"required": [
"target"
],
"properties": {
"target": {
"type": "object"
}
}
} when users click the "gear icon" to customize this task, they would see the following json added to {
"type": "che", // "type" and "target" are two required properties. only required properties are written into tasks.json
"target": {
"workingDir": "/projects/theia/production",
"containerName": "che-dev"
},
"problemMatcher": []
} if the user wants, s/he can add "label" and / or "command" into the object to override the original value(s). Would this work for you? |
I tried to do something similar to described case here.
Please see the short video: https://youtu.be/8l2UvtR9xGE |
@RomanNikitenko I tested this scenario in VS Code. If in tasks.json you have a customization config (https://code.visualstudio.com/docs/editor/tasks#_customizing-autodetected-tasks), and no detected task can be found for it, that customization config won't be displayed in the list of quick-open-task, and therefore, users won't get the chance to run the detected task associated with. The task you added to the json file
is a configured task, not a customization config, so you can run it without having any issues. |
@elaihau So, if I understand correctly, alignment with VS Code behavior will have no influence on configured tasks. |
@RomanNikitenko exactly ! no impact on the configured tasks. |
- in the current Theia, when users configure a detected task, the entire task config is written into tasks.json, which introduces redundancy. With this change, only properties that define the detected task, plus `problemMatcher`, are written into tasks.json. (fixed #5679) - `TaskConfigurations.taskCustomizations` is a flat array, and the user can only customize one type of detected task in one way. With this change Theia supports having different ways of task customization in different root folders. Signed-off-by: Liang Huang <liang.huang@ericsson.com>
- edit the right task.json when clicking "configure task" in multi-root workspace (fixed #4919) - in the current Theia, when users configure a detected task, the entire task config is written into tasks.json, which introduces redundancy. With this change, only properties that define the detected task, plus `problemMatcher`, are written into tasks.json. (fixed #5679) - `TaskConfigurations.taskCustomizations` is a flat array, and the user can only customize one type of detected task in one way. With this change Theia supports having different ways of task customization in different root folders. - The detected tasks, once customized, should be displayed as configured tasks in the quick open. (fixed #5747) - The same task shouldn’t have more than one customization. Otherwise it would cause ambiguities and duplication in tasks.json (fixed #5719) Signed-off-by: Liang Huang <liang.huang@ericsson.com>
- edit the right task.json when clicking "configure task" in multi-root workspace (fixed #4919) - in the current Theia, when users configure a detected task, the entire task config is written into tasks.json, which introduces redundancy. With this change, only properties that define the detected task, plus `problemMatcher`, are written into tasks.json. (fixed #5679) - `TaskConfigurations.taskCustomizations` is a flat array, and the user can only customize one type of detected task in one way. With this change Theia supports having different ways of task customization in different root folders. - The detected tasks, once customized, should be displayed as configured tasks in the quick open. (fixed #5747) - The same task shouldn’t have more than one customization. Otherwise it would cause ambiguities and duplication in tasks.json (fixed #5719) Signed-off-by: Liang Huang <liang.huang@ericsson.com>
- edit the right task.json when clicking "configure task" in multi-root workspace (fixed #4919) - in the current Theia, when users configure a detected task, the entire task config is written into tasks.json, which introduces redundancy. With this change, only properties that define the detected task, plus `problemMatcher`, are written into tasks.json. (fixed #5679) - allow users to override any task properties other than the ones used in the task definition. - `TaskConfigurations.taskCustomizations` is a flat array, and the user can only customize one type of detected task in one way. With this change Theia supports having different ways of task customization in different root folders. - The detected tasks, once customized, should be displayed as configured tasks in the quick open. (fixed #5747) - The same task shouldn’t have more than one customization. Otherwise it would cause ambiguities and duplication in tasks.json (fixed #5719) Signed-off-by: Liang Huang <liang.huang@ericsson.com>
- edit the right task.json when clicking "configure task" in multi-root workspace (fixed #4919) - in the current Theia, when users configure a detected task, the entire task config is written into tasks.json, which introduces redundancy. With this change, only properties that define the detected task, plus `problemMatcher`, are written into tasks.json. (fixed #5679) - allow users to override any task properties other than the ones used in the task definition. - `TaskConfigurations.taskCustomizations` is a flat array, and the user can only customize one type of detected task in one way. With this change Theia supports having different ways of task customization in different root folders. - The detected tasks, once customized, should be displayed as configured tasks in the quick open. (fixed #5747) - The same task shouldn’t have more than one customization. Otherwise it would cause ambiguities and duplication in tasks.json (fixed #5719) Signed-off-by: Liang Huang <liang.huang@ericsson.com>
- edit the right task.json when clicking "configure task" in multi-root workspace (fixed #4919) - in the current Theia, when users configure a detected task, the entire task config is written into tasks.json, which introduces redundancy. With this change, only properties that define the detected task, plus `problemMatcher`, are written into tasks.json. (fixed #5679) - allow users to override any task properties other than `type`, and those that are used to define the in its task definition. - `TaskConfigurations.taskCustomizations` is a flat array, and the user can only customize one type of detected task in one way. With this change Theia supports having different ways of task customization in different root folders. - The detected tasks, once customized, should be displayed as configured tasks in the quick open. (fixed #5747) - The same task shouldn’t have more than one customization. Otherwise it would cause ambiguities and duplication in tasks.json (fixed #5719) Signed-off-by: Liang Huang <liang.huang@ericsson.com>
- edit the right task.json when clicking "configure task" in multi-root workspace (fixed #4919) - in the current Theia, when users configure a detected task, the entire task config is written into tasks.json, which introduces redundancy. With this change, only properties that define the detected task, plus `problemMatcher`, are written into tasks.json. (fixed #5679) - allow users to override any task properties other than `type`, and those that are used to define the in its task definition. - `TaskConfigurations.taskCustomizations` is a flat array, and the user can only customize one type of detected task in one way. With this change Theia supports having different ways of task customization in different root folders. - The detected tasks, once customized, should be displayed as configured tasks in the quick open. (fixed #5747) - The same task shouldn’t have more than one customization. Otherwise it would cause ambiguities and duplication in tasks.json (fixed #5719) Signed-off-by: Liang Huang <liang.huang@ericsson.com>
- edit the right task.json when clicking "configure task" in multi-root workspace (fixed #4919) - in the current Theia, when users configure a detected task, the entire task config is written into tasks.json, which introduces redundancy. With this change, only properties that define the detected task, plus `problemMatcher`, are written into tasks.json. (fixed #5679) - allow users to override any task properties other than `type`, and those that are used to define the in its task definition. - `TaskConfigurations.taskCustomizations` is a flat array, and the user can only customize one type of detected task in one way. With this change Theia supports having different ways of task customization in different root folders. - The detected tasks, once customized, should be displayed as configured tasks in the quick open. (fixed #5747) - The same task shouldn’t have more than one customization. Otherwise it would cause ambiguities and duplication in tasks.json (fixed #5719) Signed-off-by: Liang Huang <liang.huang@ericsson.com>
Description
In theia, when customizing a detected task, users could potentially change any property of the task:
In vscode, users are only allowed to customize 3 things:
We should align this behavior with vsCode. Conceptually, being able to customize anything is beyond "customization" - it is more like "using the existing task as a template to create a new task".
Reproduction Steps
1, Open the list of tasks which includes at least one detected task
2, Click the gear icon right hand side of the detected task to customize it
3, Check what Theia adds to
.theia/tasks.json
The text was updated successfully, but these errors were encountered: