mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 21:09:43 +00:00
computeStickyModel: check token cancellation because it signals that the model is disposed
This commit is contained in:
parent
8cf85bdb16
commit
2999ca59c5
|
@ -157,7 +157,7 @@ abstract class StickyModelCandidateProvider<T> implements IStickyModelCandidateP
|
|||
public abstract get provider(): LanguageFeatureRegistry<object> | null;
|
||||
|
||||
public computeStickyModel(textModel: ITextModel, modelVersionId: number, token: CancellationToken): { statusPromise: Promise<Status> | Status; modelPromise: CancelablePromise<T | null> | null } {
|
||||
if (!this.isProviderValid(textModel)) {
|
||||
if (token.isCancellationRequested || !this.isProviderValid(textModel)) {
|
||||
return { statusPromise: this._invalid(), modelPromise: null };
|
||||
}
|
||||
const providerModelPromise = createCancelablePromise(token => this.createModelFromProvider(textModel, modelVersionId, token));
|
||||
|
|
Loading…
Reference in a new issue