Class: ExtensionService
molecule.ExtensionService
Implements
Constructors
constructor
• new ExtensionService()
Defined in
services/extensionService.ts:126
Properties
_inactive
• Private
_inactive: undefined
| Function
Defined in
services/extensionService.ts:118
_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
services/extensionService.ts:124
colorThemeService
• Private
Readonly
colorThemeService: IColorThemeService
Defined in
services/extensionService.ts:116
extensions
• Private
extensions: IExtension
[] = []
Defined in
services/extensionService.ts:115
localeService
• Private
Readonly
localeService: ILocaleService
Defined in
services/extensionService.ts:119
monacoService
• Private
Readonly
monacoService: IMonacoService
Defined in
services/extensionService.ts:117
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
services/extensionService.ts:211
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
services/extensionService.ts:152
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
services/extensionService.ts:229
disposeAll
▸ disposeAll(): void
Dispose all extensions, and reset the ExtensionService
Returns
void
Implementation of
Defined in
services/extensionService.ts:239
executeCommand
▸ executeCommand(id
, ...args
): void
Execute the registered command
Parameters
Name | Type |
---|---|
id | any |
...args | any [] |
Returns
void
Implementation of
IExtensionService.executeCommand
Defined in
services/extensionService.ts:207
getAllExtensions
▸ getAllExtensions(): IExtension
[]
Get All loaded extensions
Returns
Extension Array
Implementation of
IExtensionService.getAllExtensions
Defined in
services/extensionService.ts:148
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
services/extensionService.ts:140
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
services/extensionService.ts:246
isInactive
▸ Private
isInactive(extension
): boolean
Parameters
Name | Type |
---|---|
extension | IExtension |
Returns
boolean
Defined in
services/extensionService.ts:250
isLoaded
▸ isLoaded(): boolean
whether the extensions are loaded
Returns
boolean
Implementation of
Defined in
services/extensionService.ts:136
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
services/extensionService.ts:172
loadContributes
▸ loadContributes(contributes
): void
Parameters
Name | Type |
---|---|
contributes | IContribute |
Returns
void
Defined in
services/extensionService.ts:185
registerAction
▸ registerAction(ActionClass
): IDisposable
Register a new action which is extends the Action2, and return a disposable instance.
Parameters
Name | Type |
---|---|
ActionClass | () => Action2 |
Returns
IDisposable
IDisposable The Disposable instance
Implementation of
IExtensionService.registerAction
Defined in
services/extensionService.ts:203
reset
▸ reset(): void
Reset the extensions to []
Returns
void
Implementation of
Defined in
services/extensionService.ts:144
setLoaded
▸ setLoaded(flag?
): void
Set the extensions are loaded
Parameters
Name | Type |
---|---|
flag? | boolean |
Returns
void
Implementation of
Defined in
services/extensionService.ts:132
splitLanguagesExts
▸ splitLanguagesExts(extensions
): [IExtension
[], IExtension
[]]
Distinguish the language extensions from extensions
Parameters
Name | Type |
---|---|
extensions | IExtension [] |
Returns
[IExtension
[], IExtension
[]]
Implementation of
IExtensionService.splitLanguagesExts