Editar

Partilhar via


ICodeEditorContributionEndpoints interface

These functions will be made available to extensions to interact with the code editor.

Methods

getJsonSchemas()

Get the list of currently registered JSON schemas.

getResourceUriFromResourceVersion(IResourceVersion)

Get a resource URI for the specified resource.

getResourceVersion(string)

Get resource version from specified resource URI.

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)
registerJsonSchemas(IJsonSchemaRegistration[])

Register schemas with the code editor's built-in JSON language

registerLanguage(ILanguageRegistration)

Register a language with the code editor.

Method Details

getJsonSchemas()

Get the list of currently registered JSON schemas.

function getJsonSchemas(): Promise<IJsonSchemaRegistration[]>

Returns

getResourceUriFromResourceVersion(IResourceVersion)

Get a resource URI for the specified resource.

function getResourceUriFromResourceVersion(version: IResourceVersion): Promise<string>

Parameters

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

registerJsonSchemas(IJsonSchemaRegistration[])

Register schemas with the code editor's built-in JSON language

function registerJsonSchemas(schemas: IJsonSchemaRegistration[])

Parameters

registerLanguage(ILanguageRegistration)

Register a language with the code editor.

function registerLanguage(registration: ILanguageRegistration)

Parameters

registration
ILanguageRegistration