Merge from vscode e3c4990c67c40213af168300d1cfeb71d680f877 (#16569)

This commit is contained in:
Cory Rivera
2021-08-25 16:28:29 -07:00
committed by GitHub
parent ab1112bfb3
commit cb7b7da0a4
1752 changed files with 59525 additions and 33878 deletions

View File

@@ -4,6 +4,7 @@
*--------------------------------------------------------------------------------------------*/
import * as vscode from 'vscode';
import { equals } from '../util/arrays';
export class MarkdownPreviewConfiguration {
public static getForResource(resource: vscode.Uri) {
@@ -21,7 +22,7 @@ export class MarkdownPreviewConfiguration {
public readonly lineHeight: number;
public readonly fontSize: number;
public readonly fontFamily: string | undefined;
public readonly styles: string[];
public readonly styles: readonly string[];
private constructor(resource: vscode.Uri) {
const editorConfig = vscode.workspace.getConfiguration('editor', resource);
@@ -49,7 +50,7 @@ export class MarkdownPreviewConfiguration {
}
public isEqualTo(otherConfig: MarkdownPreviewConfiguration) {
for (let key in this) {
for (const key in this) {
if (this.hasOwnProperty(key) && key !== 'styles') {
if (this[key] !== otherConfig[key]) {
return false;
@@ -57,17 +58,7 @@ export class MarkdownPreviewConfiguration {
}
}
// Check styles
if (this.styles.length !== otherConfig.styles.length) {
return false;
}
for (let i = 0; i < this.styles.length; ++i) {
if (this.styles[i] !== otherConfig.styles[i]) {
return false;
}
}
return true;
return equals(this.styles, otherConfig.styles);
}
[key: string]: any;