Fix TS compile errors

This commit is contained in:
Alex Dima 2018-03-06 16:24:13 +01:00
parent bde41475b5
commit 6283645114
3 changed files with 3 additions and 3 deletions

View file

@ -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++) {

View file

@ -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;

View file

@ -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 {