Create a diagnostics collection.
The name of the collection.
A new diagnostic collection.
Get all diagnostics for a given resource. Note that this includes diagnostics from all extensions but not yet from the task framework.
A resource
An array of diagnostics objects or an empty array.
Get all diagnostics. Note that this includes diagnostics from all extensions but not yet from the task framework.
An array of uri-diagnostics tuples or an empty array.
Return the identifiers of all known languages.
Promise resolving to an array of identifier strings.
Compute the match between a document selector and a document. Values greater than zero mean the selector matches the document.
A match is computed according to these rules:
DocumentSelector
is an array, compute the match for each contained DocumentFilter
or language identifier and take the maximum value.language
-part of a DocumentFilter
, so "fooLang"
is like { language: "fooLang" }
.DocumentFilter
will be matched against the document by comparing its parts with the document. The following rules apply:DocumentFilter
is empty ({}
) the result is 0
scheme
, language
, or pattern
are defined but one doesn’t match, the result is 0
*
gives a score of 5
, matching via equality or via a glob-pattern gives a score of 10
Samples:
// default document from disk (file-scheme)
doc.uri; //'file:///my/file.js'
doc.languageId; // 'javascript'
match('javascript', doc); // 10;
match({language: 'javascript'}, doc); // 10;
match({language: 'javascript', scheme: 'file'}, doc); // 10;
match('*', doc); // 5
match('fooLang', doc); // 0
match(['fooLang', '*'], doc); // 5
// virtual document, e.g. from git-index
doc.uri; // 'git:/my/file.js'
doc.languageId; // 'javascript'
match('javascript', doc); // 10;
match({language: 'javascript', scheme: 'git'}, doc); // 10;
match('*', doc); // 5
A document selector.
A text document.
A number >0
when the selector matches and 0
when the selector does not match.
Register a code action provider.
Multiple providers can be registered for a language. In that case providers are asked in parallel and the results are merged. A failing provider (rejected promise or exception) will not cause a failure of the whole operation.
A selector that defines the documents this provider is applicable to.
A code action provider.
Metadata about the kind of code actions the provider providers.
A disposable that unregisters this provider when being disposed.
Register a code lens provider.
Multiple providers can be registered for a language. In that case providers are asked in parallel and the results are merged. A failing provider (rejected promise or exception) will not cause a failure of the whole operation.
A selector that defines the documents this provider is applicable to.
A code lens provider.
A disposable that unregisters this provider when being disposed.
Register a completion provider.
Multiple providers can be registered for a language. In that case providers are sorted by their score and groups of equal score are sequentially asked for completion items. The process stops when one or many providers of a group return a result. A failing provider (rejected promise or exception) will not fail the whole operation.
A selector that defines the documents this provider is applicable to.
A completion provider.
Trigger completion when the user types one of the characters, like .
or :
.
A disposable that unregisters this provider when being disposed.
Register a definition provider.
Multiple providers can be registered for a language. In that case providers are asked in parallel and the results are merged. A failing provider (rejected promise or exception) will not cause a failure of the whole operation.
A selector that defines the documents this provider is applicable to.
A definition provider.
A disposable that unregisters this provider when being disposed.
Register a formatting provider for a document.
Multiple providers can be registered for a language. In that case providers are sorted by their score and the best-matching provider is used. Failure of the selected provider will cause a failure of the whole operation.
A selector that defines the documents this provider is applicable to.
A document formatting edit provider.
A disposable that unregisters this provider when being disposed.
Register a document link provider.
Multiple providers can be registered for a language. In that case providers are asked in parallel and the results are merged. A failing provider (rejected promise or exception) will not cause a failure of the whole operation.
A selector that defines the documents this provider is applicable to.
A document link provider.
A disposable that unregisters this provider when being disposed.
Register a formatting provider for a document range.
Note: A document range provider is also a document formatter which means there is no need to register a document formatter when also registering a range provider.
Multiple providers can be registered for a language. In that case providers are sorted by their score and the best-matching provider is used. Failure of the selected provider will cause a failure of the whole operation.
A selector that defines the documents this provider is applicable to.
A document range formatting edit provider.
A disposable that unregisters this provider when being disposed.
Register a document symbol provider.
Multiple providers can be registered for a language. In that case providers are asked in parallel and the results are merged. A failing provider (rejected promise or exception) will not cause a failure of the whole operation.
A selector that defines the documents this provider is applicable to.
A document symbol provider.
A disposable that unregisters this provider when being disposed.
Register a hover provider.
Multiple providers can be registered for a language. In that case providers are asked in parallel and the results are merged. A failing provider (rejected promise or exception) will not cause a failure of the whole operation.
A selector that defines the documents this provider is applicable to.
A hover provider.
A disposable that unregisters this provider when being disposed.
Register a formatting provider that works on type. The provider is active when the user enables the setting editor.formatOnType
.
Multiple providers can be registered for a language. In that case providers are sorted by their score and the best-matching provider is used. Failure of the selected provider will cause a failure of the whole operation.
A selector that defines the documents this provider is applicable to.
An on type formatting edit provider.
A character on which formatting should be triggered, like }
.
More trigger characters.
A disposable that unregisters this provider when being disposed.
Register a reference provider.
Multiple providers can be registered for a language. In that case providers are asked in parallel and the results are merged. A failing provider (rejected promise or exception) will not cause a failure of the whole operation.
A selector that defines the documents this provider is applicable to.
A reference provider.
A disposable that unregisters this provider when being disposed.
Register a signature help provider.
Multiple providers can be registered for a language. In that case providers are sorted by their score and called sequentially until a provider returns a valid result.
A selector that defines the documents this provider is applicable to.
A signature help provider.
Trigger signature help when the user types one of the characters, like ,
or (
.
A disposable that unregisters this provider when being disposed.
Set a language configuration for a language.
A language identifier like typescript
.
Language configuration.
A disposable that unsets this configuration.
An event which fires when the global set of diagnostics changes. This is newly added and removed diagnostics.