ICodeEditorContributionEndpoints interface
These functions will be made available to extensions to interact with the code editor.
Methods
get |
Get the list of currently registered JSON schemas. |
get |
Get a resource URI for the specified resource. |
get |
Get resource version from specified resource URI. |
on |
Register a callback to be informed when a change happens to the current resource:
|
register |
Register schemas with the code editor's built-in JSON language |
register |
Register a language with the code editor. |
Method Details
getJsonSchemas()
Get the list of currently registered JSON schemas.
function getJsonSchemas(): Promise<IJsonSchemaRegistration[]>
Returns
Promise<IJsonSchemaRegistration[]>
getResourceUriFromResourceVersion(IResourceVersion)
Get a resource URI for the specified resource.
function getResourceUriFromResourceVersion(version: IResourceVersion): Promise<string>
Parameters
- version
- IResourceVersion
Returns
Promise<string>
getResourceVersion(string)
Get resource version from specified resource URI.
function getResourceVersion(uri: string): Promise<IResourceVersion>
Parameters
- uri
-
string
Returns
Promise<IResourceVersion>
onResourceChanged(ResourceChangedCallback)
Register a callback to be informed when a change happens to the current resource:
- a new file is loaded
- the user edits the file in the web UI
- the detected language changes (ie after an extension registered a new language, and the file was detected to have that language)
function onResourceChanged(callback: ResourceChangedCallback)
Parameters
- callback
- ResourceChangedCallback
registerJsonSchemas(IJsonSchemaRegistration[])
Register schemas with the code editor's built-in JSON language
function registerJsonSchemas(schemas: IJsonSchemaRegistration[])
Parameters
- schemas
registerLanguage(ILanguageRegistration)
Register a language with the code editor.
function registerLanguage(registration: ILanguageRegistration)
Parameters
- registration
- ILanguageRegistration