Merge VS Code 1.31.1 (#4283)

This commit is contained in:
Matt Irvine
2019-03-15 13:09:45 -07:00
committed by GitHub
parent 7d31575149
commit 86bac90001
1716 changed files with 53308 additions and 48375 deletions

View File

@@ -242,7 +242,7 @@ class PieceTreeSearchCache {
public valdiate(offset: number) {
let hasInvalidVal = false;
let tmp: (CacheEntry | null)[] = this._cache;
let tmp: Array<CacheEntry | null> = this._cache;
for (let i = 0; i < tmp.length; i++) {
let nodePos = tmp[i]!;
if (nodePos.node.parent === null || nodePos.nodeStartOffset >= offset) {
@@ -254,8 +254,7 @@ class PieceTreeSearchCache {
if (hasInvalidVal) {
let newArr: CacheEntry[] = [];
for (let i = 0; i < tmp.length; i++) {
const entry = tmp[i];
for (const entry of tmp) {
if (entry !== null) {
newArr.push(entry);
}
@@ -1042,7 +1041,7 @@ export class PieceTreeBase {
while (text.length > AverageBufferSize) {
const lastChar = text.charCodeAt(AverageBufferSize - 1);
let splitText;
if (lastChar === CharCode.CarriageReturn || (lastChar >= 0xd800 && lastChar <= 0xdbff)) {
if (lastChar === CharCode.CarriageReturn || (lastChar >= 0xD800 && lastChar <= 0xDBFF)) {
// last character is \r or a high surrogate => keep it back
splitText = text.substring(0, AverageBufferSize - 1);
text = text.substring(AverageBufferSize - 1);

View File

@@ -103,7 +103,7 @@ export class PieceTreeTextBufferBuilder implements ITextBufferBuilder {
}
const lastChar = chunk.charCodeAt(chunk.length - 1);
if (lastChar === CharCode.CarriageReturn || (lastChar >= 0xd800 && lastChar <= 0xdbff)) {
if (lastChar === CharCode.CarriageReturn || (lastChar >= 0xD800 && lastChar <= 0xDBFF)) {
// last character is \r or a high surrogate => keep it back
this._acceptChunk1(chunk.substr(0, chunk.length - 1), false);
this._hasPreviousChar = true;