Struct umm::vscode::Task

source ·
pub struct Task {
Show 18 fields label: String, type: Option<Type>, command: String, windows: Option<String>, group: Option<String>, presentation: Option<Presentation>, options: Option<String>, args: Option<Vec<Args>>, depends_on: Option<Vec<String>>, depends_order: Option<DependsOrder>, detail: Option<String>, icon: Option<String>, is_background: Option<bool>, linux: Option<String>, osx: Option<String>, problem_matcher: Option<Vec<ProblemMatcher>>, prompt_on_close: Option<bool>, run_options: Option<String>,
}
Expand description

Struct to represent a VSCode task as JSON.

Fields§

§label: String

The task’s label used in the user interface.

§type: Option<Type>

The task’s type.

§command: String

The actual command to execute.

§windows: Option<String>

Any Windows specific properties. Will be used instead of the default properties when the command is executed on the Windows operating system.

§group: Option<String>

Defines to which group the task belongs. In the example, it belongs to the test group. Tasks that belong to the test group can be executed by running Run Test Task from the Command Palette.

§presentation: Option<Presentation>

Defines how the task output is handled in the user interface.

§options: Option<String>

Override the defaults for cwd (current working directory), env (environment variables), or shell (default shell). Options can be set per task but also globally or per platform. Environment variables configured here can only be referenced from within your task script or process and will not be resolved if they are part of your args, command, or other task attributes.

§args: Option<Vec<Args>>

Arguments passed to the command when this task is invoked.

§depends_on: Option<Vec<String>>

Either a string representing another task or an array of other tasks that this task depends on.

§depends_order: Option<DependsOrder>

Run all dependsOn tasks in parallel.

§detail: Option<String>

An optional description of a task that shows in the Run Task quick pick as a detail.

§icon: Option<String>

An optional icon path.

§is_background: Option<bool>

Whether the executed task is kept alive and is running in the background.

§linux: Option<String>

Any linux specific properties. Will be used instead of the default properties when the command is executed on the Linux operating system.

§osx: Option<String>

Any macOS specific properties. Will be used instead of the default properties when the command is executed on the macOS operating system.

§problem_matcher: Option<Vec<ProblemMatcher>>

The problem matcher(s) to use. Can either be a string or a problem matcher definition or an array of strings and problem matchers.

§prompt_on_close: Option<bool>

Whether the user is prompted when VS Code closes with a running task.

§run_options: Option<String>

The task’s run related options. Valid values are:

  • reevaluateOnRerun: Controls how variables are evaluated when a task is executed through the Rerun Last Task command. The default is true, meaning that variables will be reevaluated when a task is rerun. When set to false the resolved variable values from the previous run of the task will be used.
  • runOn: Specifies when a task is run.
  • default - The task will only be run when executed through the Run Task command.
  • folderOpen - The task will be run when the containing folder is opened. The first time you open a folder that contains a task with folderOpen, you will be asked if you want to allow tasks to run automatically in that folder. You can change your decision later using the Manage Automatic Tasks in Folder command and selecting between Allow Automatic Tasks in Folder and Disallow Automatic Tasks in Folder.

Implementations§

source§

impl Task

source

pub fn builder( ) -> TaskBuilder<((), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), ())>

Create a builder for building Task. On the builder, call .label(...), .r#type(...)(optional), .command(...)(optional), .windows(...)(optional), .group(...)(optional), .presentation(...)(optional), .options(...)(optional), .args(...)(optional), .depends_on(...)(optional), .depends_order(...)(optional), .detail(...)(optional), .icon(...)(optional), .is_background(...)(optional), .linux(...)(optional), .osx(...)(optional), .problem_matcher(...)(optional), .prompt_on_close(...)(optional), .run_options(...)(optional) to set the values of the fields. Finally, call .build() to create the instance of Task.

Trait Implementations§

source§

impl<'de> Deserialize<'de> for Task

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Serialize for Task

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

§

impl RefUnwindSafe for Task

§

impl Send for Task

§

impl Sync for Task

§

impl Unpin for Task

§

impl UnwindSafe for Task

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into<'async_trait>( self ) -> Pin<Box<dyn Future<Output = Result<U, <U as TryFrom<T>>::Error>> + 'async_trait>>
where T: 'async_trait,

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,