Skip to main content
API module

sources API

All 10 public APIs exported from the sources module, with declarations, documentation, and source-backed examples.

Generated from typings/index.d.ts @ 555f5ceon

sources

sources.names

Names of registered sources.

Source

API signature

sources.names: ReadonlyArray<string>
Returns
ReadonlyArray<string>
Declaration
typings/index.d.ts:9268
sources

sources.sources

Field/Property sources.sources exported by sources.

Source

API signature

sources.sources: ReadonlyArray<ISource>
Returns
ReadonlyArray<ISource>
Declaration
typings/index.d.ts:9269
sources

sources.has

Check if source exists by name.

Source

API signature

sources.has(name: string): boolean

Parameters

ParameterType
namestring
Returns
boolean
Declaration
typings/index.d.ts:9273
sources

sources.getSource

Get source by name.

Source

API signature

sources.getSource(name: string): ISource | null

Parameters

ParameterType
namestring
Returns
ISource | null
Declaration
typings/index.d.ts:9277
sources

sources.addSource

Add source to sources list.

Note: Use sources.createSource() to register new source is recommended for user configuration support.

Source

API signature

sources.addSource(source: ISource): Disposable

Parameters

ParameterType
sourceISource
Returns
Disposable
Declaration
typings/index.d.ts:9285
sources

sources.createSource

Create source by source config, configurations starts with coc.source.{name} are automatically supported.

name and doComplete() must be provided in config.

Source

API signature

sources.createSource(config: SourceConfig): Disposable

Parameters

ParameterType
configSourceConfig
Returns
Disposable
Declaration
typings/index.d.ts:9293
sources

sources.sourceStats

Get list of all source stats.

Source

API signature

sources.sourceStats(): SourceStat[]
Returns
SourceStat[]
Declaration
typings/index.d.ts:9298
sources

sources.refresh

Call refresh for name source or all sources.

Source

API signature

sources.refresh(name?: string): Promise<void>

Parameters

ParameterType
name?string
Returns
Promise<void>
Declaration
typings/index.d.ts:9303
sources

sources.toggleSource

Toggle state of name source.

Source

API signature

sources.toggleSource(name: string): void

Parameters

ParameterType
namestring
Returns
void
Declaration
typings/index.d.ts:9308
sources

sources.removeSource

Remove source by name.

Source

API signature

sources.removeSource(name: string): void

Parameters

ParameterType
namestring
Returns
void
Declaration
typings/index.d.ts:9313