EditorService
class
Properties
| Name | Type | Description |
|---|---|---|
commands (readonly) |
Observable<ICommand[]> |
|
editorGroups (readonly) |
Observable<EditorGroup[]> |
Opened editor groups. |
id (readonly) |
"workbench.contrib.editor-service" |
Unique identifier of the contribution. |
onDidOpen (readonly) |
Observable<Uri> |
Emitted after opening a resource. |
onWillOpen (readonly) |
Observable<Uri> |
Emitted before opening a resource. |
state (readonly) |
Observable<EditorState> |
State of the editor. |
activeEditor |
unknown |
|
activeGroup |
unknown |
|
activeResource |
unknown |
|
dropHandlers |
unknown |
|
visibleEditors |
unknown |
activate()
Signature
activate(): voidReturns
void
close()
Signature
close(resource: Uri, force?: boolean): Promise<any>Parameters
resource(Uri) - the resource to close.force(boolean) - Whentrue, force close the resource without asking to save it if it is dirty.
Returns
Promise<any>
closeAll()
Signature
closeAll(force?: boolean): Promise<void>Parameters
force(boolean) - Whentrue, force close the resources without asking to save the dirty ones.
Returns
Promise<void>
deactivate()
Signature
deactivate(): voidReturns
void
findGroup()
Signature
findGroup(predicate: Predicate<EditorGroup>): EditorGroup | undefinedParameters
predicate(Predicate<EditorGroup>) - the predicate to test.
Returns
EditorGroup | undefined
findGroupById()
Signature
findGroupById(id: string): EditorGroup | undefinedParameters
id(string) - the id of the group
Returns
EditorGroup | undefined
findGroups()
Signature
findGroups(predicate: Predicate<EditorGroup>): EditorGroup[]Parameters
predicate(Predicate<EditorGroup>) - the predicate to test.
Returns
EditorGroup[]
isActiveGroup()
Signature
isActiveGroup(group: EditorGroup): booleanParameters
group(EditorGroup) - the group.
Returns
boolean
isOpened()
Signature
isOpened(resource: Uri): booleanParameters
resource(Uri) - The resource to test.
Returns
boolean
open()
Signature
open(resource: Uri, options?: Partial<OpenOptions>): Promise<boolean>Parameters
resource(Uri) - The resource to open.options(Partial<OpenOptions>) - Open options.
Returns
Promise<boolean>
registerCommands()
Signature
registerCommands(...commands: (ICommand | Type<ICommand>)[]): voidParameters
...commands((ICommand | Type<ICommand>)[]) - the commands to register.
Returns
void
registerDropInEditorHandler()
Signature
registerDropInEditorHandler(handler: DropIntoEditorHandler): voidParameters
handler(DropIntoEditorHandler) - the handler to register.
Returns
void
registerEditors()
Signature
registerEditors(...editors: Editor[]): voidParameters
...editors(Editor[]) - Editors to register.
Returns
void
saveActiveResource()
Signature
saveActiveResource(): Promise<void>Returns
Promise<void>
saveAll()
Signature
saveAll(): Promise<any>Returns
Promise<any>
setActiveGroup()
Signature
setActiveGroup(group: EditorGroup): voidParameters
group(EditorGroup) - the group to focus.
Returns
void