Class: ExtensionService
molecule.ExtensionService
Implements
Constructors
constructor
• new ExtensionService()
Defined in
src/services/extensionService.ts:122
Properties
_inactive
• Private _inactive: undefined | Function
Defined in
src/services/extensionService.ts:114
_isLoaded
• Private _isLoaded: boolean = false
TODO: This property is used for marking the extensions were loaded we are going to refactor this logic after redesign the Molecule lifecycle.
Defined in
src/services/extensionService.ts:120
colorThemeService
• Private Readonly colorThemeService: IColorThemeService
Defined in
src/services/extensionService.ts:112
extensions
• Private extensions: IExtension[] = []
Defined in
src/services/extensionService.ts:111
localeService
• Private Readonly localeService: ILocaleService
Defined in
src/services/extensionService.ts:115
monacoService
• Private Readonly monacoService: IMonacoService
Defined in
src/services/extensionService.ts:113
Methods
activate
▸ activate(extensions): void
Activate the extensions (includes contributes type).
Notice: this method only do the activate work, not store the data into ExtensionService,
which means you can't get the Extension by the ExtensionService. getExtension method.
Parameters
| Name | Type |
|---|---|
extensions | IExtension[] |
Returns
void
Implementation of
Defined in
src/services/extensionService.ts:207
add
▸ add(extensions): null | IExtension[]
Add the extensions to ExtensionService, but no activated.
Parameters
| Name | Type |
|---|---|
extensions | IExtension[] |
Returns
null | IExtension[]
Unload Extensions
Implementation of
Defined in
src/services/extensionService.ts:148
dispose
▸ dispose(extensionId): void
Dispose the specific extension, and remove it from the ExtensionService
Parameters
| Name | Type |
|---|---|
extensionId | UniqueId |
Returns
void
Implementation of
Defined in
src/services/extensionService.ts:225
disposeAll
▸ disposeAll(): void
Dispose all extensions, and reset the ExtensionService
Returns
void
Implementation of
Defined in
src/services/extensionService.ts:235
executeCommand
▸ executeCommand(id, ...args): void
Execute the registered command
Parameters
| Name | Type |
|---|---|
id | any |
...args | any[] |
Returns
void
Implementation of
IExtensionService.executeCommand
Defined in
src/services/extensionService.ts:203
getAllExtensions
▸ getAllExtensions(): IExtension[]
Get All loaded extensions
Returns
Extension Array
Implementation of
IExtensionService.getAllExtensions
Defined in
src/services/extensionService.ts:144
getExtension
▸ getExtension(id): undefined | IExtension
Get an extension by the ID
Parameters
| Name | Type |
|---|---|
id | UniqueId |
Returns
undefined | IExtension
Implementation of
IExtensionService.getExtension
Defined in
src/services/extensionService.ts:136
inactive
▸ inactive(predicate): void
Disable to activate some extensions, make use of it to filter some extensions no need to activate. You need register the inactive event before the MoleculeProvider declaration.
Parameters
| Name | Type |
|---|---|
predicate | (extension: IExtension) => boolean |
Returns
void
Implementation of
Defined in
src/services/extensionService.ts:242
isInactive
▸ Private isInactive(extension): boolean
Parameters
| Name | Type |
|---|---|
extension | IExtension |
Returns
boolean
Defined in
src/services/extensionService.ts:246
isLoaded
▸ isLoaded(): boolean
whether the extensions are loaded
Returns
boolean
Implementation of
Defined in
src/services/extensionService.ts:132
load
▸ load(extensions): void
Load the extension instances and then activate them.
Notice: The ExtensionService doesn't load an existed Extension, if you want inactivate
someone extension, there can use the ExtensionService.inactive method, also if you want
remove a extension, you can use the ExtensionService.dispose method.
Parameters
| Name | Type |
|---|---|
extensions | IExtension[] |
Returns
void
Implementation of
Defined in
src/services/extensionService.ts:168
loadContributes
▸ loadContributes(contributes): void
Parameters
| Name | Type |
|---|---|
contributes | IContribute |
Returns
void
Defined in
src/services/extensionService.ts:181
registerAction
▸ registerAction(actionClass): void
Register a new action which is extends the Action2,
Parameters
| Name | Type |
|---|---|
actionClass | () => Action2 |
Returns
void
Implementation of
IExtensionService.registerAction
Defined in
src/services/extensionService.ts:199
reset
▸ reset(): void
Reset the extensions to []
Returns
void
Implementation of
Defined in
src/services/extensionService.ts:140
setLoaded
▸ setLoaded(flag?): void
Set the extensions are loaded
Parameters
| Name | Type |
|---|---|
flag? | boolean |
Returns
void
Implementation of
Defined in
src/services/extensionService.ts:128
splitLanguagesExts
▸ splitLanguagesExts(extensions): [IExtension[], IExtension[]]
Distinguish the language extensions from extensions
Parameters
| Name | Type |
|---|---|
extensions | IExtension[] |
Returns
[IExtension[], IExtension[]]
Implementation of
IExtensionService.splitLanguagesExts