Class javascript.JsonAstManager
Provides a shared AST for JSON files.
Defined in: </jobs/genie.orion/orion-client-stable/workspace/bundles/org.eclipse.orion.client.javascript/web/javascript/jsonAstManager.js>.
Constructor Attributes | Constructor Name and Description |
---|---|
Provides a shared AST.
|
Method Attributes | Method Name and Description |
---|---|
getAST(editorContext, fileName)
Returns the AST representing the text from the backing editor context
|
|
getJSON(editorContext, fileName)
|
|
getWellFormedAST(editorContext, fileName)
Returns an ESTree spec-compliant AST
|
|
onFileChanged(event)
Callback from the FileClient
|
|
onInputChanged(event)
Callback from the orion.edit.model service
|
|
onModelChanging(event)
Callback from the orion.edit.model service
|
Method Detail
{orion.Promise}
getAST(editorContext, fileName)
Returns the AST representing the text from the backing editor context
- Parameters:
- {orion.editor.EditorContext} editorContext
- {String} fileName
- The name of the file we want the AST for. This name is checked against the file metadata, and if the names to not match, return null
- Deprecated:
- This function is provided only to be able to use the malformed AST that the parser provides out of the box. Callers should use the getWellFormedAST function that produces an ESTree-spec compliant AST
- Returns:
- {orion.Promise} A promise resolving to the AST.
getJSON(editorContext, fileName)
- Parameters:
- editorContext
- fileName
{Deferred}
getWellFormedAST(editorContext, fileName)
Returns an ESTree spec-compliant AST
- Parameters:
- {EditorContext} editorContext
- The backing editor context
- {String} fileName
- The name of the file to get the AST for
- Returns:
- {Deferred} A promise to return an AST
onFileChanged(event)
Callback from the FileClient
- Parameters:
- {Object} event
- a Changed event
onInputChanged(event)
Callback from the orion.edit.model service
- Parameters:
- {Object} event
- An orion.edit.model event.
- See:
- https://wiki.eclipse.org/Orion/Documentation/Developer_Guide/Plugging_into_the_editor#orion.edit.model
onModelChanging(event)
Callback from the orion.edit.model service
- Parameters:
- {Object} event
- An orion.edit.model event.
- See:
- https://wiki.eclipse.org/Orion/Documentation/Developer_Guide/Plugging_into_the_editor#orion.edit.model