Skip to content

Commit 6af9c15

Browse files
author
aiday-mar
committed
Change order of cancellation of token with iteration over different providers
1 parent 437379a commit 6af9c15

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,9 @@ export class StickyLineCandidateProvider extends Disposable {
108108
const model = this._editor.getModel();
109109
const modelVersionId = model.getVersionId();
110110
let outlineModel = await OutlineModel.create(this._languageFeaturesService.documentSymbolProvider, model, token) as OutlineModel;
111-
111+
if (token.isCancellationRequested) {
112+
return;
113+
}
112114
// When several possible outline providers
113115
if (outlineModel.children.size !== 0 && outlineModel.children.values().next().value instanceof OutlineGroup) {
114116
if (outlineModel.children.has(this._providerString)) {
@@ -127,9 +129,6 @@ export class StickyLineCandidateProvider extends Disposable {
127129
outlineModel = outlineModel.children.get(this._providerString) as unknown as OutlineModel;
128130
}
129131
}
130-
if (token.isCancellationRequested) {
131-
return;
132-
}
133132
this._outlineModel = StickyOutlineElement.fromOutlineModel(outlineModel);
134133
this._modelVersionId = modelVersionId;
135134
}

0 commit comments

Comments
 (0)