Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to support strictBuiltinIteratorReturn #222009

Merged
merged 1 commit into from
Jul 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions extensions/grunt/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand All @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions extensions/gulp/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand All @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions extensions/jake/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand All @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
Expand Down
4 changes: 2 additions & 2 deletions src/vs/workbench/contrib/scm/browser/dirtydiffDecorator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)];
}
Expand All @@ -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)];
}
Expand Down
6 changes: 3 additions & 3 deletions src/vs/workbench/contrib/timeline/browser/timelinePane.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -766,15 +766,15 @@ 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;
let nextSource;
while (nextSource = getNextMostRecentSource()) {
nextSource.timeline.lastRenderedIndex++;

const item = nextSource.nextItem.value;
const item = nextSource.nextItem.value!;
item.relativeTime = undefined;
item.hideRelativeTime = undefined;

Expand Down
Loading