mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-14 20:34:30 +01:00
Use standard for/of loop
This commit is contained in:
@@ -38,13 +38,13 @@ export class CustomEditorModelManager implements ICustomEditorModelManager {
|
||||
|
||||
public disposeModel(model: ICustomEditorModel): void {
|
||||
let foundKey: string | undefined;
|
||||
this._models.forEach((value, key) => {
|
||||
for (const [key, value] of this._models) {
|
||||
if (model === value.model) {
|
||||
value.disposables.dispose();
|
||||
value.model.dispose();
|
||||
foundKey = key;
|
||||
}
|
||||
});
|
||||
}
|
||||
if (typeof foundKey === 'string') {
|
||||
this._models.delete(foundKey);
|
||||
}
|
||||
@@ -52,11 +52,11 @@ export class CustomEditorModelManager implements ICustomEditorModelManager {
|
||||
}
|
||||
|
||||
public disposeAllModelsForView(viewType: string): void {
|
||||
this._models.forEach((value) => {
|
||||
for (const [, value] of this._models) {
|
||||
if (value.model.viewType === viewType) {
|
||||
this.disposeModel(value.model);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private key(resource: URI, viewType: string): string {
|
||||
|
||||
@@ -51,7 +51,7 @@ export class WebviewIconManager {
|
||||
try {
|
||||
const cssRules: string[] = [];
|
||||
if (this._configService.getValue('workbench.iconTheme') !== null) {
|
||||
this._icons.forEach((value, key) => {
|
||||
for (const [key, value] of this._icons) {
|
||||
const webviewSelector = `.show-file-icons .webview-${key}-name-file-icon::before`;
|
||||
if (URI.isUri(value)) {
|
||||
cssRules.push(`${webviewSelector} { content: ""; background-image: ${dom.asCSSUrl(value)}; }`);
|
||||
@@ -59,7 +59,7 @@ export class WebviewIconManager {
|
||||
cssRules.push(`.vs ${webviewSelector} { content: ""; background-image: ${dom.asCSSUrl(value.light)}; }`);
|
||||
cssRules.push(`.vs-dark ${webviewSelector} { content: ""; background-image: ${dom.asCSSUrl(value.dark)}; }`);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
this._styleElement.innerHTML = cssRules.join('\n');
|
||||
} catch {
|
||||
|
||||
Reference in New Issue
Block a user