CommandService
class
Properties
| Name | Type | Description |
|---|---|---|
id (readonly) |
"workbench.contrib.commands" |
Unique identifier of the contribution. |
deactivate()
Signature
deactivate(): voidReturns
void
execute()
Signature
execute(id: string): Promise<void>Parameters
id(string) - A command identifier.
Returns
Promise<void>
find()
Signature
find(id: string | Type<ICommand>): TParameters
id(string | Type<ICommand>)
Returns
T
findAll()
Signature
findAll(predicate: (command: ICommand) => boolean): Observable<T[]>Parameters
predicate((command: ICommand) => boolean) - A predicate function that returns true if the command should be returned.
Returns
Observable<T[]>
findAllByPrefix()
Signature
findAllByPrefix(prefix: string): Observable<T[]>Parameters
prefix(string) - Prefix to search for.
Returns
Observable<T[]>
onAfterExecute()
Signature
onAfterExecute(commandId?: string): Observable<CommandEvent>Parameters
commandId(string) - Identifier of the command to listen to.
Returns
Observable<CommandEvent>
onBeforeExecute()
Signature
onBeforeExecute(commandId?: string): Observable<CommandEvent>Parameters
commandId(string) - Identifier of the command to listen to.
Returns
Observable<CommandEvent>
register()
Signature
register(...commands: (ICommand | Type<ICommand>)[]): voidParameters
...commands((ICommand | Type<ICommand>)[]) - The commands to register.
Returns
void