Update to support strictBuiltinIteratorReturn (#222009)

pull/213498/head^2
Ron Buckton 2024-07-22 15:25:52 -04:00 committed by GitHub
parent 709d1b879a
commit 74a977b209
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 12 additions and 12 deletions

View File

@ -316,7 +316,7 @@ class TaskDetector {
if (this.detectors.size === 0) {
return Promise.resolve([]);
} else if (this.detectors.size === 1) {
return this.detectors.values().next().value.getTasks();
return this.detectors.values().next().value!.getTasks();
} else {
const promises: Promise<vscode.Task[]>[] = [];
for (const detector of this.detectors.values()) {
@ -338,7 +338,7 @@ class TaskDetector {
if (this.detectors.size === 0) {
return undefined;
} else if (this.detectors.size === 1) {
return this.detectors.values().next().value.getTask(task);
return this.detectors.values().next().value!.getTask(task);
} else {
if ((task.scope === vscode.TaskScope.Workspace) || (task.scope === vscode.TaskScope.Global)) {
return undefined;

View File

@ -357,7 +357,7 @@ class TaskDetector {
if (this.detectors.size === 0) {
return Promise.resolve([]);
} else if (this.detectors.size === 1) {
return this.detectors.values().next().value.getTasks();
return this.detectors.values().next().value!.getTasks();
} else {
const promises: Promise<vscode.Task[]>[] = [];
for (const detector of this.detectors.values()) {
@ -379,7 +379,7 @@ class TaskDetector {
if (this.detectors.size === 0) {
return undefined;
} else if (this.detectors.size === 1) {
return this.detectors.values().next().value.getTask(task);
return this.detectors.values().next().value!.getTask(task);
} else {
if ((task.scope === vscode.TaskScope.Workspace) || (task.scope === vscode.TaskScope.Global)) {
// Not supported, we don't have enough info to create the task.

View File

@ -290,7 +290,7 @@ class TaskDetector {
if (this.detectors.size === 0) {
return Promise.resolve([]);
} else if (this.detectors.size === 1) {
return this.detectors.values().next().value.getTasks();
return this.detectors.values().next().value!.getTasks();
} else {
const promises: Promise<vscode.Task[]>[] = [];
for (const detector of this.detectors.values()) {
@ -312,7 +312,7 @@ class TaskDetector {
if (this.detectors.size === 0) {
return undefined;
} else if (this.detectors.size === 1) {
return this.detectors.values().next().value.getTask(task);
return this.detectors.values().next().value!.getTask(task);
} else {
if ((task.scope === vscode.TaskScope.Workspace) || (task.scope === vscode.TaskScope.Global)) {
// Not supported, we don't have enough info to create the task.

View File

@ -152,7 +152,7 @@ export class WorkerBasedDocumentDiffProvider implements IDocumentDiffProvider, I
// max 10 items in cache
if (WorkerBasedDocumentDiffProvider.diffCache.size > 10) {
WorkerBasedDocumentDiffProvider.diffCache.delete(WorkerBasedDocumentDiffProvider.diffCache.keys().next().value);
WorkerBasedDocumentDiffProvider.diffCache.delete(WorkerBasedDocumentDiffProvider.diffCache.keys().next().value!);
}
WorkerBasedDocumentDiffProvider.diffCache.set(uriKey, { result, context });

View File

@ -787,7 +787,7 @@ export class DirtyDiffController extends Disposable implements DirtyDiffContribu
if (this.editor.hasModel() && (typeof lineNumber === 'number' || !this.widget.provider)) {
index = this.model.findNextClosestChange(typeof lineNumber === 'number' ? lineNumber : this.editor.getPosition().lineNumber, true, this.widget.provider);
} else {
const providerChanges: number[] = this.model.mapChanges.get(this.widget.provider) ?? this.model.mapChanges.values().next().value;
const providerChanges: number[] = this.model.mapChanges.get(this.widget.provider) ?? this.model.mapChanges.values().next().value!;
const mapIndex = providerChanges.findIndex(value => value === this.widget!.index);
index = providerChanges[rot(mapIndex + 1, providerChanges.length)];
}
@ -807,7 +807,7 @@ export class DirtyDiffController extends Disposable implements DirtyDiffContribu
if (this.editor.hasModel() && (typeof lineNumber === 'number')) {
index = this.model.findPreviousClosestChange(typeof lineNumber === 'number' ? lineNumber : this.editor.getPosition().lineNumber, true, this.widget.provider);
} else {
const providerChanges: number[] = this.model.mapChanges.get(this.widget.provider) ?? this.model.mapChanges.values().next().value;
const providerChanges: number[] = this.model.mapChanges.get(this.widget.provider) ?? this.model.mapChanges.values().next().value!;
const mapIndex = providerChanges.findIndex(value => value === this.widget!.index);
index = providerChanges[rot(mapIndex - 1, providerChanges.length)];
}

View File

@ -732,7 +732,7 @@ export class TimelinePane extends ViewPane {
timeline.lastRenderedIndex = count - 1;
}
else {
const sources: { timeline: TimelineAggregate; iterator: IterableIterator<TimelineItem>; nextItem: IteratorResult<TimelineItem, TimelineItem> }[] = [];
const sources: { timeline: TimelineAggregate; iterator: IterableIterator<TimelineItem>; nextItem: IteratorResult<TimelineItem, undefined> }[] = [];
let hasAnyItems = false;
let mostRecentEnd = 0;
@ -766,7 +766,7 @@ export class TimelinePane extends ViewPane {
function getNextMostRecentSource() {
return sources
.filter(source => !source.nextItem.done)
.reduce((previous, current) => (previous === undefined || current.nextItem.value.timestamp >= previous.nextItem.value.timestamp) ? current : previous, undefined!);
.reduce((previous, current) => (previous === undefined || current.nextItem.value!.timestamp >= previous.nextItem.value!.timestamp) ? current : previous, undefined!);
}
let lastRelativeTime: string | undefined;
@ -774,7 +774,7 @@ export class TimelinePane extends ViewPane {
while (nextSource = getNextMostRecentSource()) {
nextSource.timeline.lastRenderedIndex++;
const item = nextSource.nextItem.value;
const item = nextSource.nextItem.value!;
item.relativeTime = undefined;
item.hideRelativeTime = undefined;