From 62836451143cc6a7ccb68d17386f68bf9d058849 Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Tue, 6 Mar 2018 16:24:13 +0100 Subject: [PATCH] Fix TS compile errors --- src/vs/editor/common/model/pieceTreeTextBuffer/pieceTreeBase.ts | 2 +- src/vs/editor/common/model/textModelTokens.ts | 2 +- src/vs/editor/contrib/snippet/snippetParser.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/vs/editor/common/model/pieceTreeTextBuffer/pieceTreeBase.ts b/src/vs/editor/common/model/pieceTreeTextBuffer/pieceTreeBase.ts index 24d85ffdfec3b..0d9c29f6d3727 100644 --- a/src/vs/editor/common/model/pieceTreeTextBuffer/pieceTreeBase.ts +++ b/src/vs/editor/common/model/pieceTreeTextBuffer/pieceTreeBase.ts @@ -35,7 +35,7 @@ export class LineStarts { ) { } } -export function createLineStartsFast(str: string, readonly: boolean = true): Uint32Array | number[] { +export function createLineStartsFast(str: string, readonly: boolean = true): Uint32Array | Uint16Array | number[] { let r: number[] = [0], rLength = 1; for (let i = 0, len = str.length; i < len; i++) { diff --git a/src/vs/editor/common/model/textModelTokens.ts b/src/vs/editor/common/model/textModelTokens.ts index bc0a715dda9b7..cb7c7bf2c7d18 100644 --- a/src/vs/editor/common/model/textModelTokens.ts +++ b/src/vs/editor/common/model/textModelTokens.ts @@ -25,7 +25,7 @@ function getDefaultMetadata(topLevelLanguageId: LanguageId): number { ) >>> 0; } -const EMPTY_LINE_TOKENS = new Uint32Array(0); +const EMPTY_LINE_TOKENS = (new Uint32Array(0)).buffer; class ModelLineTokens { _state: IState; diff --git a/src/vs/editor/contrib/snippet/snippetParser.ts b/src/vs/editor/contrib/snippet/snippetParser.ts index b44c9fda3be50..2ee46939849ad 100644 --- a/src/vs/editor/contrib/snippet/snippetParser.ts +++ b/src/vs/editor/contrib/snippet/snippetParser.ts @@ -568,7 +568,7 @@ export class SnippetParser { if (marker instanceof Placeholder) { placeholderCount += 1; if (marker.isFinalTabstop) { - placeholderDefaultValues.set(0); + placeholderDefaultValues.set(0, undefined); } else if (!placeholderDefaultValues.has(marker.index) && marker.children.length > 0) { placeholderDefaultValues.set(marker.index, marker.children); } else {