Skip to content

Commit 670f92f

Browse files
authored
Merge pull request microsoft#183452 from microsoft/ulugbekna/computeStickyModel-model-is-disposed
computeStickyModel: check token cancellation because it signals that the model is disposed
2 parents 8242d20 + 2999ca5 commit 670f92f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/vs/editor/contrib/stickyScroll/browser/stickyScrollModelProvider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ abstract class StickyModelCandidateProvider<T> implements IStickyModelCandidateP
157157
public abstract get provider(): LanguageFeatureRegistry<object> | null;
158158

159159
public computeStickyModel(textModel: ITextModel, modelVersionId: number, token: CancellationToken): { statusPromise: Promise<Status> | Status; modelPromise: CancelablePromise<T | null> | null } {
160-
if (!this.isProviderValid(textModel)) {
160+
if (token.isCancellationRequested || !this.isProviderValid(textModel)) {
161161
return { statusPromise: this._invalid(), modelPromise: null };
162162
}
163163
const providerModelPromise = createCancelablePromise(token => this.createModelFromProvider(textModel, modelVersionId, token));

0 commit comments

Comments
 (0)