Skip to main content

ExtensionLoader

Import :

const ExtensionLoader = brackets.getModule("utils/ExtensionLoader")

EVENT_EXTENSION_LOADED : string

Extension loaded event

Kind: global constant

EVENT_EXTENSION_DISABLED : string

Extension disabled event

Kind: global constant

EVENT_EXTENSION_LOAD_FAILED : string

Extension load failed event

Kind: global constant

getDefaultExtensionPath() ⇒ string

Responsible to get the default extension path

Kind: global function

getUserExtensionPath()

Returns the full path of the default user extensions directory. This is in the users application support directory, which is typically /Users/"user"/Application Support/Brackets/extensions/user on the mac, and C:\Users"user"\AppData\Roaming\Brackets\extensions\user on windows.

Kind: global function

getRequireContextForExtension(name) ⇒ Object

Returns the require.js require context used to load an extension

Kind: global function
Returns: Object - A require.js require object used to load the extension, or undefined if there is no require object with that name

ParamTypeDescription
namestringused to identify the extension

loadExtension(name, config, entryPoint) ⇒ $.Promise

Loads the extension that lives at baseUrl into its own Require.js context

Kind: global function
Returns: $.Promise - A promise object that is resolved when the extension is loaded, or rejected if the extension fails to load or throws an exception immediately when loaded. (Note: if extension contains a JS syntax error, promise is resolved not rejected).

ParamTypeDescription
namestringused to identify the extension
configObjectobject with baseUrl property containing absolute path of extension
entryPointstringname of the main js file to load

testExtension(name, config, entryPoint) ⇒ $.Promise

Runs unit tests for the extension that lives at baseUrl into its own Require.js context

Kind: global function
Returns: $.Promise - A promise object that is resolved when all extensions complete loading.

ParamTypeDescription
namestringused to identify the extension
configObjectobject with baseUrl property containing absolute path of extension
entryPointstringname of the main js file to load

loadAllDefaultExtensions() ⇒ $.Promise

Loads All brackets default extensions from brackets base https URL.

Kind: global function
Returns: $.Promise - A promise object that is resolved when all extensions complete loading.

loadAllExtensionsInNativeDirectory(directory) ⇒ $.Promise

Loads the extension that lives at baseUrl into its own Require.js context

Kind: global function
Returns: $.Promise - A promise object that is resolved when all extensions complete loading.

ParamTypeDescription
directorystringan absolute native path that contains a directory of extensions. each subdirectory is interpreted as an independent extension

loadExtensionFromNativeDirectory(directory) ⇒ Promise

Loads a given extension at the path from virtual fs. Used by debug menu> load project as extension

Kind: global function

Param
directory

testAllExtensionsInNativeDirectory(directory) ⇒ $.Promise

Runs unit test for the extension that lives at baseUrl into its own Require.js context

Kind: global function
Returns: $.Promise - A promise object that is resolved when all extensions complete loading.

ParamTypeDescription
directorystringan absolute native path that contains a directory of extensions. each subdirectory is interpreted as an independent extension

testAllDefaultExtensions() ⇒ $.Promise

Runs unit test for the extension that lives at baseUrl into its own Require.js context

Kind: global function
Returns: $.Promise - A promise object that is resolved when all extensions complete loading.

getSourcePathForExtension(extensionPath) ⇒ string

To get the source path for extension

Kind: global function

Param
extensionPath

init(A) ⇒ $.Promise

Load extensions.

Kind: global function
Returns: $.Promise - A promise object that is resolved when all extensions complete loading.

ParamTypeDescription
AArray.<string>list containing references to extension source location. A source location may be either (a) a folder name inside src/extensions or (b) an absolute path.