-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Run Tasks #1798
Run Tasks #1798
Conversation
- TaskShell to execute tasks using `Process` - TaskManager to run and manage tasks - CEActive task representing a running task
- Removed unnecessary code - Rename CETaskStatus.stopped to .notRunning
- Better docs for TaskShell - Scheme and task popover appear preferably below the button - Delete unused code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few visual bugs, and a few possible race conditions with the async methods in CEActiveTask
.
CodeEdit/Features/ActivityViewer/Tasks/SchemeDropDownView.swift
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’ve taken care of those issues. Over the past few days, I’ve been thinking about how to handle tasks when they get deleted. My initial thought was that active tasks shouldn’t be removed when the run configuration is deleted, as users would lose the task output. However, it might also be really confusing if the active task stays while the configuration disappears. So, I decided to delete the active task if the run configuration is deleted. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, I think that's a good decision for the deleted tasks.
Great work!
Looks good, you have some conflicts, can you fix those please? |
CodeEdit/Features/CEWorkSpaceSettings/CEWorkspaceSettings/Models/CETask.swift
Show resolved
Hide resolved
Should be good to go! |
Description
This PR introduces the ability to run tasks within CodeEdit, utilizing a
.codeedit
folder to store task configurations. The goal is to enable users to create and manage tasks quickly and easily.Simple Tasks Example:
Tasks with Environment Variables:
Key Structures Introduced:
CETask
: Configuration for executing a task, including command and environment settings.CEActiveTask
: Represents a running task with output and status (running, stopped, failed, succeeded). CETask is injected into CEActiveTask with essential information such as full command and environment variables.CETaskManager
: Handles active tasks (run, renew, suspend, resume, terminate, interrupt).CEWorkspaceSettings
: Holds workspace-specific settings data. Distinct from CEWorkspaceSettingsManager, which handles workspace settings management (e.g., saving, loading).Active Task States:
An active task can be:
notRunning
: The task hasn't been interacted with yet.stopped
: The task is currently suspended(paused).running
: The task is actively running.failed
: The task finished with an error code.finished
: The task successfully completed.Task Shell Options:
TaskShell provides various shells (e.g., bash, zsh, csh) for executing commands. Currently defaults to bash; future updates may include user settings for shell preference. Tasks are executed using
executeCommandWithShell
, utilizing a SwiftProcess
to run commands within the user's environment plus additional variables fromCETask
. Output (stdout
and stderr) is captured using a
Pipe`.Important
Reviewers, please pay close attention to the usage of classes vs. structs, as well as the naming conventions for classes, functions, and variables. Clear naming decisions now will save significant effort later.
Related Issues
Checklist
Screenshots