This commit is contained in:
Alex Dima
2020-04-03 01:05:44 +02:00
parent 2e4d797e51
commit 71b26ad6c8
3 changed files with 20 additions and 5 deletions

View File

@@ -2420,7 +2420,7 @@ export class SemanticTokensLegend {
public readonly tokenTypes: string[];
public readonly tokenModifiers: string[];
constructor(tokenTypes: string[], tokenModifiers: string[]) {
constructor(tokenTypes: string[], tokenModifiers: string[] = []) {
this.tokenTypes = tokenTypes;
this.tokenModifiers = tokenModifiers;
}
@@ -2461,10 +2461,13 @@ export class SemanticTokensBuilder {
}
}
public push(line: number, char: number, length: number, tokenType: number, tokenModifiers: number): void;
public push(line: number, char: number, length: number, tokenType: number, tokenModifiers?: number): void;
public push(range: Range, tokenType: string, tokenModifiers?: string[]): void;
public push(arg0: any, arg1: any, arg2: any, arg3?: any, arg4?: any): void {
if (typeof arg0 === 'number' && typeof arg1 === 'number' && typeof arg2 === 'number' && typeof arg3 === 'number' && typeof arg4 === 'number') {
if (typeof arg0 === 'number' && typeof arg1 === 'number' && typeof arg2 === 'number' && typeof arg3 === 'number' && (typeof arg4 === 'number' || typeof arg4 === 'undefined')) {
if (typeof arg4 === 'undefined') {
arg4 = 0;
}
// 1st overload
return this._pushEncoded(arg0, arg1, arg2, arg3, arg4);
}