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.
An event which fires when the global set of diagnostics changes. This is newly added and removed diagnostics.
Register a call hierarchy provider.
Multiple provider 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 disposable that unregisters this provider when being disposed.
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 color 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 color 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 declaration 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 declaration provider.
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 highlight provider.
Multiple providers can be registered for a language. In that case providers are sorted
by their score and groups sequentially asked for document highlights.
The process stops when a provider returns a non-falsy
or non-failure
result.
A selector that defines the documents this provider is applicable to.
A document highlight 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 semantic tokens provider for a document range.
Note: If a document has both a DocumentSemanticTokensProvider
and a DocumentRangeSemanticTokensProvider
,
the range provider will be invoked only initially, for the time in which the full document provider takes
to resolve the first request. Once the full document provider resolves the first request, the semantic tokens
provided via the range provider will be discarded and from that point forward, only the document provider
will be used.
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 semantic tokens provider.
A disposable that unregisters this provider when being disposed.
Register a semantic tokens provider for a whole 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 semantic tokens 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 folding range provider.
Multiple providers can be registered for a language. In that case providers are asked in parallel and the results are merged. If multiple folding ranges start at the same position, only the range of the first registered provider is used. If a folding range overlaps with an other range that has a smaller position, it is also ignored.
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 folding range 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 an implementation 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.
An implementation 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 reference 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 rename provider.
A disposable that unregisters this provider when being disposed.
Register a selection range 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 selection range 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.
Register a type 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 type definition provider.
A disposable that unregisters this provider when being disposed.
Register a workspace 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 workspace symbol provider.
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.
Set (and change) the language that is associated with the given document.
Note that calling this function will trigger the onDidCloseTextDocument
event
followed by the onDidOpenTextDocument
event.
The document which language is to be changed
The new language identifier.
A thenable that resolves with the updated document.
Create a diagnostics collection.