mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 21:09:43 +00:00
Merge pull request #183452 from microsoft/ulugbekna/computeStickyModel-model-is-disposed
computeStickyModel: check token cancellation because it signals that the model is disposed
This commit is contained in:
commit
670f92f22b
|
@ -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