Generated baselines with clean file text (without marker)
This makes it easier to copy paste the file text in the editor when verifying
This commit is contained in:
Родитель
0076313da7
Коммит
fd25d9aeda
|
@ -1,9 +1,9 @@
|
|||
original file
|
||||
-----------------------------------
|
||||
^^abstract class Animal {
|
||||
abstract class Animal {
|
||||
public age: number;
|
||||
public yearsLeft() { return 20 - this.age; }
|
||||
^^abstract makeSound(): string;
|
||||
abstract makeSound(): string;
|
||||
}
|
||||
|
||||
class Cow extends Animal {
|
||||
|
|
|
@ -3,7 +3,7 @@ original file
|
|||
// Issue: https://github.com/Microsoft/TypeScript-Sublime-Plugin/issues/292
|
||||
|
||||
var object = {
|
||||
setTransform: ^^<^^(^^domNode: ^^HTMLElement, ^^desiredValue: ^^string) ^^=> ^^void>^^null,
|
||||
setTransform: <(domNode: HTMLElement, desiredValue: string) => void>null,
|
||||
setDisplay: (domNode: HTMLElement, desiredValue: string) => {
|
||||
if (domNode.style.display !== desiredValue) {
|
||||
domNode.style.display = desiredValue;
|
||||
|
@ -16,7 +16,7 @@ function f(x: string | ((value: string) => number)) {
|
|||
return +x
|
||||
}
|
||||
else {
|
||||
let f = ^^<^^(^^v: ^^string) ^^=> ^^number^^> ^^x
|
||||
let f = <(v: string) => number> x
|
||||
return f("hello world")
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,68 +8,68 @@ Pull requests:
|
|||
- https://github.com/Microsoft/TypeScript-Sublime-Plugin/pull/308
|
||||
*/
|
||||
|
||||
var ^^/* comment */ x: string = "yahoo";
|
||||
var x ^^/* comment */: string = "yahoo";
|
||||
var x: ^^/* comment */ string = "yahoo";
|
||||
var x: string ^^/* comment */ = "yahoo";
|
||||
var x: string = ^^/* comment */ "yahoo";
|
||||
var x: string = "yahoo" ^^/* comment */;
|
||||
var x: string = "yahoo"; ^^/* comment */
|
||||
var /* comment */ x: string = "yahoo";
|
||||
var x /* comment */: string = "yahoo";
|
||||
var x: /* comment */ string = "yahoo";
|
||||
var x: string /* comment */ = "yahoo";
|
||||
var x: string = /* comment */ "yahoo";
|
||||
var x: string = "yahoo" /* comment */;
|
||||
var x: string = "yahoo"; /* comment */
|
||||
|
||||
var ^^/* comment */ x: string = "yahoo"
|
||||
var x ^^/* comment */: string = "yahoo"
|
||||
var x: ^^/* comment */ string = "yahoo"
|
||||
var x: string ^^/* comment */ = "yahoo"
|
||||
var x: string = ^^/* comment */ "yahoo"
|
||||
var x: string = "yahoo" ^^/* comment */
|
||||
var /* comment */ x: string = "yahoo"
|
||||
var x /* comment */: string = "yahoo"
|
||||
var x: /* comment */ string = "yahoo"
|
||||
var x: string /* comment */ = "yahoo"
|
||||
var x: string = /* comment */ "yahoo"
|
||||
var x: string = "yahoo" /* comment */
|
||||
|
||||
^^/**/ interface i extends i1, i2, i3 {}
|
||||
interface ^^/**/ i extends i1, i2, i3 {}
|
||||
interface i ^^/**/ extends i1, i2, i3 {}
|
||||
interface i extends ^^/**/ i1, i2, i3 {}
|
||||
interface i extends i1 ^^/**/, i2, i3 {}
|
||||
interface i extends i1, ^^/**/ i2, i3 {}
|
||||
interface i extends i1, i2 ^^/**/, i3 {}
|
||||
interface i extends i1, i2, ^^/**/ i3 {}
|
||||
interface i extends i1, i2, i3 ^^/**/ {}
|
||||
^^/**/ interface ^^/**/ i ^^/**/ extends ^^/**/ i1, ^^/**/ i2, ^^/**/ i3 ^^/**/ {}
|
||||
^^/**/ interface ^^/**/ i ^^/**/ extends ^^/**/ i1 ^^/**/ , ^^/**/ i2 ^^/**/ , ^^/**/ i3 ^^/**/ {}
|
||||
/**/ interface i extends i1, i2, i3 {}
|
||||
interface /**/ i extends i1, i2, i3 {}
|
||||
interface i /**/ extends i1, i2, i3 {}
|
||||
interface i extends /**/ i1, i2, i3 {}
|
||||
interface i extends i1 /**/, i2, i3 {}
|
||||
interface i extends i1, /**/ i2, i3 {}
|
||||
interface i extends i1, i2 /**/, i3 {}
|
||||
interface i extends i1, i2, /**/ i3 {}
|
||||
interface i extends i1, i2, i3 /**/ {}
|
||||
/**/ interface /**/ i /**/ extends /**/ i1, /**/ i2, /**/ i3 /**/ {}
|
||||
/**/ interface /**/ i /**/ extends /**/ i1 /**/ , /**/ i2 /**/ , /**/ i3 /**/ {}
|
||||
|
||||
^^/**/class i extends c1,c2,c3{}
|
||||
class^^/**/i extends c1,c2,c3{}
|
||||
class i^^/**/extends c1,c2,c3{}
|
||||
class i extends^^/**/c1,c2,c3{}
|
||||
class i extends c1^^/**/,c2,c3{}
|
||||
class i extends c1,^^/**/c2,c3{}
|
||||
class i extends c1,c2^^/**/,c3{}
|
||||
class i extends c1,c2,^^/**/c3{}
|
||||
class i extends c1,c2,c3^^/**/{}
|
||||
^^/**/class^^/**/i^^/**/extends^^/**/c1,^^/**/c2,^^/**/c3^^/**/{}
|
||||
^^/**/class^^/**/i^^/**/extends^^/**/c1^^/**/,^^/**/c2^^/**/,^^/**/c3^^/**/{}
|
||||
/**/class i extends c1,c2,c3{}
|
||||
class/**/i extends c1,c2,c3{}
|
||||
class i/**/extends c1,c2,c3{}
|
||||
class i extends/**/c1,c2,c3{}
|
||||
class i extends c1/**/,c2,c3{}
|
||||
class i extends c1,/**/c2,c3{}
|
||||
class i extends c1,c2/**/,c3{}
|
||||
class i extends c1,c2,/**/c3{}
|
||||
class i extends c1,c2,c3/**/{}
|
||||
/**/class/**/i/**/extends/**/c1,/**/c2,/**/c3/**/{}
|
||||
/**/class/**/i/**/extends/**/c1/**/,/**/c2/**/,/**/c3/**/{}
|
||||
|
||||
interface KeyValuePair^^/**/<K, V> extends Array<K | V> { 0: K; 1: V; }
|
||||
interface KeyValuePair<K, V>^^/**/extends Array<K | V> { 0: K; 1: V; }
|
||||
interface KeyValuePair<K, V> extends^^/**/Array<K | V> { 0: K; 1: V; }
|
||||
interface KeyValuePair<K, V> extends Array^^/**/<K | V> { 0: K; 1: V; }
|
||||
interface KeyValuePair<K, V> extends Array<K | V>^^/**/{ 0: K; 1: V; }
|
||||
interface KeyValuePair/**/<K, V> extends Array<K | V> { 0: K; 1: V; }
|
||||
interface KeyValuePair<K, V>/**/extends Array<K | V> { 0: K; 1: V; }
|
||||
interface KeyValuePair<K, V> extends/**/Array<K | V> { 0: K; 1: V; }
|
||||
interface KeyValuePair<K, V> extends Array/**/<K | V> { 0: K; 1: V; }
|
||||
interface KeyValuePair<K, V> extends Array<K | V>/**/{ 0: K; 1: V; }
|
||||
|
||||
interface G^^/**/<extends_, _extends extends Function> {
|
||||
interface G/**/<extends_, _extends extends Function> {
|
||||
f<V extends U>(x: V): V;
|
||||
}
|
||||
interface G<extends_, _extends^^/**/extends Function> {
|
||||
interface G<extends_, _extends/**/extends Function> {
|
||||
f<V extends U>(x: V): V;
|
||||
}
|
||||
interface G<extends_, _extends extends^^/**/Function> {
|
||||
interface G<extends_, _extends extends/**/Function> {
|
||||
f<V extends U>(x: V): V;
|
||||
}
|
||||
|
||||
var x^^/*comments*/=new String();
|
||||
var x=^^/*comments*/new String();
|
||||
var x= new^^/*comments*/String();
|
||||
var x/*comments*/=new String();
|
||||
var x=/*comments*/new String();
|
||||
var x= new/*comments*/String();
|
||||
|
||||
var x ^^/* comments */ = new String();
|
||||
var x = ^^/* comments */ new String();
|
||||
var x = new ^^/* comments */ String();
|
||||
var x /* comments */ = new String();
|
||||
var x = /* comments */ new String();
|
||||
var x = new /* comments */ String();
|
||||
-----------------------------------
|
||||
|
||||
Grammar: TypeScript.tmLanguage
|
||||
|
|
|
@ -1,54 +1,54 @@
|
|||
original file
|
||||
-----------------------------------
|
||||
/* Function overload tests */
|
||||
^^export function ^^testFunctionOverload(p: number): new() => any
|
||||
^^export function ^^testFunctionOverload(p: string)
|
||||
^^export function ^^testFunctionOverload(p: string [])
|
||||
^^export function ^^testFunctionOverload(p: {})
|
||||
^^export function ^^testFunctionOverload(p: {a: A, b:B} | string [])
|
||||
^^export function ^^testFunctionOverload(p: any): new() => any {
|
||||
^^throw new Error("")
|
||||
export function testFunctionOverload(p: number): new() => any
|
||||
export function testFunctionOverload(p: string)
|
||||
export function testFunctionOverload(p: string [])
|
||||
export function testFunctionOverload(p: {})
|
||||
export function testFunctionOverload(p: {a: A, b:B} | string [])
|
||||
export function testFunctionOverload(p: any): new() => any {
|
||||
throw new Error("")
|
||||
}
|
||||
|
||||
^^export function ^^testFunctionOverloadWithSemicolon(p: number): new () => any;
|
||||
^^export function ^^testFunctionOverloadWithSemicolon(p: string);
|
||||
^^export function ^^testFunctionOverloadWithSemicolon(p: string[]);
|
||||
^^export function ^^testFunctionOverloadWithSemicolon(p: {});
|
||||
^^export function ^^testFunctionOverloadWithSemicolon(p: { a: A, b: B } | string[]);
|
||||
^^export function ^^testFunctionOverloadWithSemicolon(p: any): new () => any {
|
||||
^^throw new Error("")
|
||||
export function testFunctionOverloadWithSemicolon(p: number): new () => any;
|
||||
export function testFunctionOverloadWithSemicolon(p: string);
|
||||
export function testFunctionOverloadWithSemicolon(p: string[]);
|
||||
export function testFunctionOverloadWithSemicolon(p: {});
|
||||
export function testFunctionOverloadWithSemicolon(p: { a: A, b: B } | string[]);
|
||||
export function testFunctionOverloadWithSemicolon(p: any): new () => any {
|
||||
throw new Error("")
|
||||
}
|
||||
|
||||
|
||||
class testClass {
|
||||
/* Function overload tests */
|
||||
^^public ^^testMethodOverload(p: number): new() => any
|
||||
^^public ^^testMethodOverload(p: string)
|
||||
^^public ^^testMethodOverload(p: string [])
|
||||
^^public ^^testMethodOverload(p: {})
|
||||
^^public ^^testMethodOverload(p: {a: A, b:B} | string [])
|
||||
^^public ^^testMethodOverload(p: any): new() => any {
|
||||
^^throw new Error("")
|
||||
public testMethodOverload(p: number): new() => any
|
||||
public testMethodOverload(p: string)
|
||||
public testMethodOverload(p: string [])
|
||||
public testMethodOverload(p: {})
|
||||
public testMethodOverload(p: {a: A, b:B} | string [])
|
||||
public testMethodOverload(p: any): new() => any {
|
||||
throw new Error("")
|
||||
}
|
||||
|
||||
^^public ^^testMethodOverloadWithSemicolon(p: number): new () => any;
|
||||
^^public ^^testMethodOverloadWithSemicolon(p: string);
|
||||
^^public ^^testMethodOverloadWithSemicolon(p: string[]);
|
||||
^^public ^^testMethodOverloadWithSemicolon(p: {});
|
||||
^^public ^^testMethodOverloadWithSemicolon(p: { a: A, b: B } | string[]);
|
||||
^^public ^^testMethodOverloadWithSemicolon(p: any): new () => any {
|
||||
^^throw new Error("")
|
||||
public testMethodOverloadWithSemicolon(p: number): new () => any;
|
||||
public testMethodOverloadWithSemicolon(p: string);
|
||||
public testMethodOverloadWithSemicolon(p: string[]);
|
||||
public testMethodOverloadWithSemicolon(p: {});
|
||||
public testMethodOverloadWithSemicolon(p: { a: A, b: B } | string[]);
|
||||
public testMethodOverloadWithSemicolon(p: any): new () => any {
|
||||
throw new Error("")
|
||||
}
|
||||
}
|
||||
|
||||
interface I {
|
||||
^^foo(): number
|
||||
^^bar(): string;
|
||||
foo(): number
|
||||
bar(): string;
|
||||
}
|
||||
|
||||
abstract class C {
|
||||
^^abstract ^^foo()
|
||||
^^abstract ^^bar()
|
||||
abstract foo()
|
||||
abstract bar()
|
||||
}
|
||||
-----------------------------------
|
||||
|
||||
|
|
|
@ -2,33 +2,33 @@ original file
|
|||
-----------------------------------
|
||||
/* Function parameter tests */
|
||||
function testFunctionParamType(
|
||||
^^m1: string,
|
||||
^^m2: {},
|
||||
^^m3: any [],
|
||||
^^m4: {a: A, b: B},
|
||||
^^m5: () => void,
|
||||
^^m6: (x:(string), y:[number, string]) => number,
|
||||
^^m7: Array<number>,
|
||||
^^m8: [number, number],
|
||||
^^m9: {a: A, b: B} | [number, number],
|
||||
^^m10: (() => void) | string[]): number {
|
||||
^^return m6.length;
|
||||
m1: string,
|
||||
m2: {},
|
||||
m3: any [],
|
||||
m4: {a: A, b: B},
|
||||
m5: () => void,
|
||||
m6: (x:(string), y:[number, string]) => number,
|
||||
m7: Array<number>,
|
||||
m8: [number, number],
|
||||
m9: {a: A, b: B} | [number, number],
|
||||
m10: (() => void) | string[]): number {
|
||||
return m6.length;
|
||||
}
|
||||
|
||||
class testClass {
|
||||
/* method param type tests */
|
||||
public testMethodParamType(
|
||||
^^m1: string,
|
||||
^^m2: {},
|
||||
^^m3: any [],
|
||||
^^m4: {a: A, b: B},
|
||||
^^m5: () => void,
|
||||
^^m6: (x:(string), y:[number, string]) => number,
|
||||
^^m7: Array<number>,
|
||||
^^m8: [number, number],
|
||||
^^m9: {a: A, b: B} | [number, number],
|
||||
^^m10: (() => void) | string[]): number {
|
||||
^^return m6.length;
|
||||
m1: string,
|
||||
m2: {},
|
||||
m3: any [],
|
||||
m4: {a: A, b: B},
|
||||
m5: () => void,
|
||||
m6: (x:(string), y:[number, string]) => number,
|
||||
m7: Array<number>,
|
||||
m8: [number, number],
|
||||
m9: {a: A, b: B} | [number, number],
|
||||
m10: (() => void) | string[]): number {
|
||||
return m6.length;
|
||||
}
|
||||
}
|
||||
-----------------------------------
|
||||
|
|
|
@ -1,35 +1,35 @@
|
|||
original file
|
||||
-----------------------------------
|
||||
/* Function return type tests */
|
||||
^^export function ^^testFunctionReturnType1(): string [] { ^^return [""] }
|
||||
^^export function ^^testFunctionReturnType2(): {} { ^^return {} }
|
||||
^^export function ^^testFunctionReturnType3(): {a: A, b: B} { ^^return {a: {m: "" }, b: {m1: "" }} }
|
||||
^^export function ^^testFunctionReturnType4(): [number, number] { ^^return [1, 1] }
|
||||
^^export function ^^testFunctionReturnType5(): Array<A> { ^^return [{ m: "" }] }
|
||||
^^export function ^^testFunctionReturnType6(): new () => number { ^^throw new Error(""); }
|
||||
^^export function ^^testFunctionReturnType7(): (() => number) { ^^throw new Error(""); }
|
||||
^^export function ^^testFunctionReturnType8(): (() => number) [] { ^^throw new Error(""); }
|
||||
^^export function ^^testFunctionReturnType9(): (() => number) | (() => string) { ^^throw new Error(""); }
|
||||
^^export function ^^testFunctionReturnType10(): {a: A, b: B} [] { ^^return [{a: {m: "" }, b: {m1: "" }}] }
|
||||
^^export function ^^testFunctionReturnType11(): number | string { ^^return 1 }
|
||||
^^export function ^^testFunctionReturnType12(): number | string [] { ^^return }
|
||||
^^export function ^^testFunctionReturnType13(): [number, number] | string [] { ^^return [""] }
|
||||
export function testFunctionReturnType1(): string [] { return [""] }
|
||||
export function testFunctionReturnType2(): {} { return {} }
|
||||
export function testFunctionReturnType3(): {a: A, b: B} { return {a: {m: "" }, b: {m1: "" }} }
|
||||
export function testFunctionReturnType4(): [number, number] { return [1, 1] }
|
||||
export function testFunctionReturnType5(): Array<A> { return [{ m: "" }] }
|
||||
export function testFunctionReturnType6(): new () => number { throw new Error(""); }
|
||||
export function testFunctionReturnType7(): (() => number) { throw new Error(""); }
|
||||
export function testFunctionReturnType8(): (() => number) [] { throw new Error(""); }
|
||||
export function testFunctionReturnType9(): (() => number) | (() => string) { throw new Error(""); }
|
||||
export function testFunctionReturnType10(): {a: A, b: B} [] { return [{a: {m: "" }, b: {m1: "" }}] }
|
||||
export function testFunctionReturnType11(): number | string { return 1 }
|
||||
export function testFunctionReturnType12(): number | string [] { return }
|
||||
export function testFunctionReturnType13(): [number, number] | string [] { return [""] }
|
||||
|
||||
class TestClass {
|
||||
/* method return type tests */
|
||||
^^public ^^testMethodReturnType1(): string [] { ^^return [""] }
|
||||
^^public ^^testMethodReturnType2(): {} { ^^return {} }
|
||||
^^public ^^testMethodReturnType3(): {a: A, b: B} { ^^return {a: {m: "" }, b: {m1: "" }} }
|
||||
^^public ^^testMethodReturnType4(): [number, number] { ^^return [1, 1] }
|
||||
^^public ^^testMethodReturnType5(): Array<A> { ^^return [{ m: "" }] }
|
||||
^^public ^^testMethodReturnType6(): new () => number { ^^throw new Error(""); }
|
||||
^^public ^^testMethodReturnType7(): (() => number) { ^^throw new Error(""); }
|
||||
^^public ^^testMethodReturnType8(): (() => number) [] { ^^throw new Error(""); }
|
||||
^^public ^^testMethodReturnType9(): (() => number) | (() => string) { ^^throw new Error(""); }
|
||||
^^public ^^testMethodReturnType10(): {a: A, b: B} [] { ^^return [{a: {m: "" }, b: {m1: "" }}] }
|
||||
^^public ^^testMethodReturnType11(): number | string { ^^return 1 }
|
||||
^^public ^^testMethodReturnType12(): number | string [] { ^^return }
|
||||
^^public ^^testMethodReturnType13(): [number, number] | string [] { ^^return [""] }
|
||||
public testMethodReturnType1(): string [] { return [""] }
|
||||
public testMethodReturnType2(): {} { return {} }
|
||||
public testMethodReturnType3(): {a: A, b: B} { return {a: {m: "" }, b: {m1: "" }} }
|
||||
public testMethodReturnType4(): [number, number] { return [1, 1] }
|
||||
public testMethodReturnType5(): Array<A> { return [{ m: "" }] }
|
||||
public testMethodReturnType6(): new () => number { throw new Error(""); }
|
||||
public testMethodReturnType7(): (() => number) { throw new Error(""); }
|
||||
public testMethodReturnType8(): (() => number) [] { throw new Error(""); }
|
||||
public testMethodReturnType9(): (() => number) | (() => string) { throw new Error(""); }
|
||||
public testMethodReturnType10(): {a: A, b: B} [] { return [{a: {m: "" }, b: {m1: "" }}] }
|
||||
public testMethodReturnType11(): number | string { return 1 }
|
||||
public testMethodReturnType12(): number | string [] { return }
|
||||
public testMethodReturnType13(): [number, number] | string [] { return [""] }
|
||||
}
|
||||
-----------------------------------
|
||||
|
||||
|
|
|
@ -1,24 +1,24 @@
|
|||
original file
|
||||
-----------------------------------
|
||||
let number1 = ^^0x100
|
||||
let number2 = ^^14e15
|
||||
let number3 = ^^10.42e41.5
|
||||
let number4 = ^^4
|
||||
let number5 = ^^51.4
|
||||
let number6 = ^^12.4E10.2
|
||||
let number7 = ^^14.6e+10
|
||||
let number8 = ^^12E4
|
||||
let number9 = ^^10e10
|
||||
let number10 = ^^14e14.5
|
||||
let number11 = ^^12E-10
|
||||
let number12 = ^^13.4e-14.2
|
||||
let number13 = ^^14.12
|
||||
let number14 = ^^10.2E+4
|
||||
let number6 = ^^5.00567789e+2
|
||||
let i = ^^1, j = ^^1e3
|
||||
let number1 = 0x100
|
||||
let number2 = 14e15
|
||||
let number3 = 10.42e41.5
|
||||
let number4 = 4
|
||||
let number5 = 51.4
|
||||
let number6 = 12.4E10.2
|
||||
let number7 = 14.6e+10
|
||||
let number8 = 12E4
|
||||
let number9 = 10e10
|
||||
let number10 = 14e14.5
|
||||
let number11 = 12E-10
|
||||
let number12 = 13.4e-14.2
|
||||
let number13 = 14.12
|
||||
let number14 = 10.2E+4
|
||||
let number6 = 5.00567789e+2
|
||||
let i = 1, j = 1e3
|
||||
|
||||
/*
|
||||
^^
|
||||
|
||||
Testing comments
|
||||
*/
|
||||
-----------------------------------
|
||||
|
|
|
@ -5,16 +5,16 @@ original file
|
|||
Adding capability of ternary strings.
|
||||
*/
|
||||
|
||||
let a = ^^true ? ^^true : ^^true;
|
||||
let b = ^^true ? ^^true : ^^`^^this is ^^${} highlighted`
|
||||
let c = ^^true ? ^^`^^hello` : ^^`^^this ${DEPENDENCY_SEPARATOR}${moduleName} is highlighted`;
|
||||
let a = true ? true : true;
|
||||
let b = true ? true : `this is ${} highlighted`
|
||||
let c = true ? `hello` : `this ${DEPENDENCY_SEPARATOR}${moduleName} is highlighted`;
|
||||
|
||||
var ^^newVar = ^^a ^^? ^^(b == `hello`) : ^^true;
|
||||
var newVar = a ? (b == `hello`) : true;
|
||||
|
||||
var ^^debArch = ^^arch ^^=== ^^'x64' ^^? ^^'amd64' ^^: ^^'i386';
|
||||
var debArch = arch === 'x64' ? 'amd64' : 'i386';
|
||||
|
||||
/*
|
||||
^^Comment
|
||||
Comment
|
||||
*/
|
||||
-----------------------------------
|
||||
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
original file
|
||||
-----------------------------------
|
||||
^^export function ^^fn(s: ^^string): ^^new() => ^^View
|
||||
^^export function ^^fn(s: string)
|
||||
^^export function ^^fn(n: number)
|
||||
^^export function ^^fn(s: any) {
|
||||
^^return "";
|
||||
export function fn(s: string): new() => View
|
||||
export function fn(s: string)
|
||||
export function fn(n: number)
|
||||
export function fn(s: any) {
|
||||
return "";
|
||||
}
|
||||
|
||||
^^export function ^^fn(s: string): ^^new () => ^^View;
|
||||
^^export function ^^fn(s: string);
|
||||
^^export function ^^fn(n: number);
|
||||
^^export function ^^fn(s: any) {
|
||||
^^return "";
|
||||
export function fn(s: string): new () => View;
|
||||
export function fn(s: string);
|
||||
export function fn(n: number);
|
||||
export function fn(s: any) {
|
||||
return "";
|
||||
}
|
||||
-----------------------------------
|
||||
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
original file
|
||||
-----------------------------------
|
||||
class Test {
|
||||
^^mmm(^^p1: ^^string | ^^{}, ^^p2: ^^string)
|
||||
mmm(p1: string | {}, p2: string)
|
||||
{
|
||||
^^
|
||||
|
||||
}
|
||||
}
|
||||
-----------------------------------
|
||||
|
|
|
@ -1,21 +1,21 @@
|
|||
original file
|
||||
-----------------------------------
|
||||
class Thing {
|
||||
^^constructor(^^public ^^content: ^^string){
|
||||
var ^^prop = Q.defer<^^boolean>(^^);
|
||||
^^this.store = new ^^Data();
|
||||
^^gaze(path.join(this.content, "^^**/*.json"^^), (err, watch) => {
|
||||
^^process.stuout.write(`^^Watching for changes in:`^^);
|
||||
constructor(public content: string){
|
||||
var prop = Q.defer<boolean>();
|
||||
this.store = new Data();
|
||||
gaze(path.join(this.content, "**/*.json"), (err, watch) => {
|
||||
process.stuout.write(`Watching for changes in:`);
|
||||
})
|
||||
};
|
||||
}
|
||||
|
||||
class Thing<^^T, ^^U> {
|
||||
^^constructor(^^public ^^content: ^^string){
|
||||
var ^^prop = Q.defer<^^boolean>(^^);
|
||||
^^this.store = new ^^Data();
|
||||
^^gaze(path.join(this.content, "^^**/*.json"^^), (err, watch) => {
|
||||
^^process.stuout.write(`^^Watching for changes in:`^^);
|
||||
class Thing<T, U> {
|
||||
constructor(public content: string){
|
||||
var prop = Q.defer<boolean>();
|
||||
this.store = new Data();
|
||||
gaze(path.join(this.content, "**/*.json"), (err, watch) => {
|
||||
process.stuout.write(`Watching for changes in:`);
|
||||
})
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
original file
|
||||
-----------------------------------
|
||||
^^
|
||||
|
||||
^^declare ^^module ^^'goog:goog.i18n.NumberFormatSymbols_en_TT' {
|
||||
^^import ^^alias = ^^lool.clutz.goog.i18n.NumberFormatSymbols_en_TT;
|
||||
^^export ^^default ^^alias;
|
||||
^^}^^
|
||||
|
||||
declare module 'goog:goog.i18n.NumberFormatSymbols_en_TT' {
|
||||
import alias = lool.clutz.goog.i18n.NumberFormatSymbols_en_TT;
|
||||
export default alias;
|
||||
}
|
||||
-----------------------------------
|
||||
|
||||
Grammar: TypeScript.tmLanguage
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
original file
|
||||
-----------------------------------
|
||||
var someVar = ^^new ^^Thing<^^number, ^^string>('^^data'^^);
|
||||
var someVar = ^^makeThing<^^number, ^^string>('^^data'^^);
|
||||
var someVar = new Thing<number, string>('data');
|
||||
var someVar = makeThing<number, string>('data');
|
||||
|
||||
class MyClass {
|
||||
static ^^someProp = new ^^Thing<^^number, ^^string>('data');
|
||||
static ^^someProp = ^^makeThing<^^number, ^^string>('data');
|
||||
static someProp = new Thing<number, string>('data');
|
||||
static someProp = makeThing<number, string>('data');
|
||||
|
||||
someProp = new ^^Thing<^^number, ^^string>('data');
|
||||
someProp = ^^makeThing<^^number, ^^string>('data');
|
||||
someProp = new Thing<number, string>('data');
|
||||
someProp = makeThing<number, string>('data');
|
||||
}
|
||||
-----------------------------------
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
original file
|
||||
-----------------------------------
|
||||
for (^^let a = 1; a ^^< 10; a++) {
|
||||
^^for (^^let b = 1; b < a; b++) {
|
||||
^^
|
||||
for (let a = 1; a < 10; a++) {
|
||||
for (let b = 1; b < a; b++) {
|
||||
|
||||
}
|
||||
}
|
||||
-----------------------------------
|
||||
|
|
|
@ -3,13 +3,13 @@ original file
|
|||
|
||||
/* Testing octals */
|
||||
|
||||
var x = ^^123;
|
||||
var y = ^^0x123;
|
||||
var z = ^^0b10101;
|
||||
var z = ^^0B00000;
|
||||
var j = ^^0o474774;
|
||||
var w = ^^0O767;
|
||||
^^
|
||||
var x = 123;
|
||||
var y = 0x123;
|
||||
var z = 0b10101;
|
||||
var z = 0B00000;
|
||||
var j = 0o474774;
|
||||
var w = 0O767;
|
||||
|
||||
-----------------------------------
|
||||
|
||||
Grammar: TypeScript.tmLanguage
|
||||
|
|
|
@ -3,26 +3,26 @@ original file
|
|||
// Issue 288: "function" in "functionName" gets highlighted.
|
||||
// Fixed in pull request #289.
|
||||
|
||||
function ^^Name(){
|
||||
function Name(){
|
||||
}
|
||||
var AnotherName = function^^(){
|
||||
var AnotherName = function(){
|
||||
}
|
||||
|
||||
export function ^^eName(){
|
||||
export function eName(){
|
||||
}
|
||||
export var eAnotherName = function^^(){
|
||||
export var eAnotherName = function(){
|
||||
}
|
||||
|
||||
var function^^Name=1;
|
||||
function^^Name=1;
|
||||
var functionName=1;
|
||||
functionName=1;
|
||||
|
||||
export var function^^Name2=1;
|
||||
export var functionName2=1;
|
||||
|
||||
var export^^Name="hello";
|
||||
export^^Name2="hello";
|
||||
var exportName="hello";
|
||||
exportName2="hello";
|
||||
|
||||
var return^^Name=1;
|
||||
return^^Name+=1;
|
||||
var returnName=1;
|
||||
returnName+=1;
|
||||
|
||||
-----------------------------------
|
||||
|
||||
|
|
|
@ -4,20 +4,20 @@ original file
|
|||
Testing Isuue 32: Adding constructor as a support.type keword
|
||||
*/
|
||||
|
||||
^^interface ^^NewInterface{
|
||||
^^currentData: Data;
|
||||
^^setVal(d: Data)
|
||||
interface NewInterface{
|
||||
currentData: Data;
|
||||
setVal(d: Data)
|
||||
}
|
||||
|
||||
|
||||
^^class NewClass implements NewInterface {
|
||||
^^currentData: Data;
|
||||
^^setVal(d: Data){
|
||||
^^this.currentData = d;
|
||||
class NewClass implements NewInterface {
|
||||
currentData: Data;
|
||||
setVal(d: Data){
|
||||
this.currentData = d;
|
||||
}
|
||||
^^constructor(^^m: ^^number, ^^n: ^^string){}
|
||||
constructor(m: number, n: string){}
|
||||
}
|
||||
^^
|
||||
|
||||
/*
|
||||
Testing comments
|
||||
*/
|
||||
|
|
|
@ -3,52 +3,52 @@ original file
|
|||
class A1 {
|
||||
b() {
|
||||
let d;
|
||||
d.^^default = 1;
|
||||
d.default = 1;
|
||||
}
|
||||
|
||||
^^private ^^static c() {
|
||||
private static c() {
|
||||
}
|
||||
}
|
||||
|
||||
class A2 {
|
||||
b() {
|
||||
let d;
|
||||
d.^^case = 1
|
||||
d.case = 1
|
||||
}
|
||||
|
||||
^^private ^^static c() {
|
||||
private static c() {
|
||||
}
|
||||
}
|
||||
|
||||
class A3 {
|
||||
b() {
|
||||
let d
|
||||
d.^^default = 1
|
||||
switch (d.^^default) {
|
||||
^^case 1:
|
||||
^^case 2:
|
||||
^^default:
|
||||
d.default = 1
|
||||
switch (d.default) {
|
||||
case 1:
|
||||
case 2:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
^^private ^^static c() {
|
||||
private static c() {
|
||||
}
|
||||
}
|
||||
|
||||
class A4 {
|
||||
b() {
|
||||
let d
|
||||
d.^^case = 1
|
||||
switch (d.^^default) {
|
||||
^^case 1:
|
||||
^^case 2:
|
||||
^^default:
|
||||
d.case = 1
|
||||
switch (d.default) {
|
||||
case 1:
|
||||
case 2:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
^^private ^^static c() {
|
||||
private static c() {
|
||||
}
|
||||
}
|
||||
-----------------------------------
|
||||
|
|
|
@ -2,30 +2,30 @@ original file
|
|||
-----------------------------------
|
||||
//Test For Scopes
|
||||
|
||||
^^import ^^* ^^as req ^^from "./Required"
|
||||
import * as req from "./Required"
|
||||
import { Scale } from "./scale";
|
||||
|
||||
^^if (object.^^instanceof(ClassNew)) {
|
||||
if (object.instanceof(ClassNew)) {
|
||||
}
|
||||
|
||||
^^class ^^class1(){
|
||||
^^static ^^functioname(){
|
||||
class class1(){
|
||||
static functioname(){
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
^^export ^^class className(){
|
||||
^^private ^^state = { }
|
||||
export class className(){
|
||||
private state = { }
|
||||
}
|
||||
|
||||
^^void ^^newFunctionName(){
|
||||
void newFunctionName(){
|
||||
|
||||
^^var c = a ^^+ b;
|
||||
var c = a + b;
|
||||
|
||||
^^switch (someNum) {
|
||||
^^case 1: break;
|
||||
^^case 2: break;
|
||||
^^default: break;
|
||||
switch (someNum) {
|
||||
case 1: break;
|
||||
case 2: break;
|
||||
default: break;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -34,37 +34,37 @@ import { Scale } from "./scale";
|
|||
* Verify comments
|
||||
*/
|
||||
|
||||
^^module M {
|
||||
^^export function myFun(x: number) {
|
||||
module M {
|
||||
export function myFun(x: number) {
|
||||
return x;
|
||||
}
|
||||
}
|
||||
|
||||
var m: ^^typeof M = M;
|
||||
var m: typeof M = M;
|
||||
|
||||
var adder = ^^new Adder(3, 4);
|
||||
^^delete (adder)
|
||||
var adder = new Adder(3, 4);
|
||||
delete (adder)
|
||||
|
||||
var s = typeof {}git
|
||||
interface I {}
|
||||
var j: I = {}
|
||||
|
||||
|
||||
^^module ^^Body {
|
||||
^^export ^^class ^^Cell {
|
||||
^^public ^^parent: ^^Cell;
|
||||
module Body {
|
||||
export class Cell {
|
||||
public parent: Cell;
|
||||
|
||||
^^constructor(^^parent: ^^Cell) {
|
||||
^^this.parent = ^^parent;
|
||||
if (^^typeof ^^parent ^^=== ^^'object' || ^^parent ^^instanceof ^^Error) {
|
||||
^^
|
||||
constructor(parent: Cell) {
|
||||
this.parent = parent;
|
||||
if (typeof parent === 'object' || parent instanceof Error) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
^^
|
||||
|
||||
End of file
|
||||
|
||||
*/
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
original file
|
||||
-----------------------------------
|
||||
|
||||
^^interface ^^TestInterface {
|
||||
^^testvar: ^^string;
|
||||
^^testfunc(): ^^string;
|
||||
^^}
|
||||
interface TestInterface {
|
||||
testvar: string;
|
||||
testfunc(): string;
|
||||
}
|
||||
|
||||
/*
|
||||
Testing Comments
|
||||
|
|
|
@ -1,38 +1,38 @@
|
|||
original file
|
||||
-----------------------------------
|
||||
let new_string = ^^"^^New Changes"
|
||||
^^
|
||||
let new_string = "New Changes"
|
||||
|
||||
|
||||
let plain_double_text = "Hello\
|
||||
this link to github is^^ https://github.com/\
|
||||
hello^^\
|
||||
this link to github is https://github.com/\
|
||||
hello\
|
||||
World"
|
||||
|
||||
let plain_single_text= ^^'Try with single bracket\
|
||||
hello world ^^\\\\\
|
||||
let plain_single_text= 'Try with single bracket\
|
||||
hello world \\\\\
|
||||
let this be ^\
|
||||
a good test ^'
|
||||
|
||||
let double_quote_issue = " ^^ qstring-double:\
|
||||
^^name: ^^string.double.ts^^\
|
||||
^^begin: ^^\'\"\'\
|
||||
^^end: ^^\'\"|(?:[^\r\n\\]$)'\
|
||||
^^patterns:^^\
|
||||
^^- include: ^^'#string-character-escape'^^\
|
||||
^^"
|
||||
^^
|
||||
let single_quote_issue = '^^qstring-single:^^\
|
||||
^^name: string.single.ts^^\
|
||||
^^begin: \"\'\"\
|
||||
^^end: \'|(?:[^\r\n\\]$)^^\
|
||||
^^endCaptures:^^\
|
||||
^^ '0': {name: string-character-escape }^^\
|
||||
^^patterns:^^\
|
||||
^^- include: \'#string-character-escape\'^^\
|
||||
^^'
|
||||
^^
|
||||
let new_string = ^^"^^Changes End here^^"
|
||||
^^
|
||||
let double_quote_issue = " qstring-double:\
|
||||
name: string.double.ts\
|
||||
begin: \'\"\'\
|
||||
end: \'\"|(?:[^\r\n\\]$)'\
|
||||
patterns:\
|
||||
- include: '#string-character-escape'\
|
||||
"
|
||||
|
||||
let single_quote_issue = 'qstring-single:\
|
||||
name: string.single.ts\
|
||||
begin: \"\'\"\
|
||||
end: \'|(?:[^\r\n\\]$)\
|
||||
endCaptures:\
|
||||
'0': {name: string-character-escape }\
|
||||
patterns:\
|
||||
- include: \'#string-character-escape\'\
|
||||
'
|
||||
|
||||
let new_string = "Changes End here"
|
||||
|
||||
|
||||
|
||||
-----------------------------------
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
original file
|
||||
-----------------------------------
|
||||
^^type ^^Callback <^^T> = ^^(error: Error, value: T) => any
|
||||
type Callback <T> = (error: Error, value: T) => any
|
||||
|
||||
^^type Callback^^<T > = ^^(error: Error, value: T) ^^=> ^^any
|
||||
type Callback<T > = (error: Error, value: T) => any
|
||||
|
||||
type Callback = ^^(error: Error, value: T) => ^^any
|
||||
type Callback = (error: Error, value: T) => any
|
||||
|
||||
^^type ^^Callback^^<string ^^| ^^(a: number, b: string) => ^^void> = ^^(error: Error, value: T) => ^^any
|
||||
type Callback<string | (a: number, b: string) => void> = (error: Error, value: T) => any
|
||||
|
||||
^^ type ^^Foo <^^T > = ^^{
|
||||
type Foo <T > = {
|
||||
|
||||
^^foo: ^^T,
|
||||
^^bar: ^^number
|
||||
foo: T,
|
||||
bar: number
|
||||
|
||||
^^}
|
||||
}
|
||||
-----------------------------------
|
||||
|
||||
Grammar: TypeScript.tmLanguage
|
||||
|
|
|
@ -2,10 +2,10 @@ original file
|
|||
-----------------------------------
|
||||
class Foo {
|
||||
constructor(
|
||||
^^test: ^^number, //^^ foo bar,
|
||||
^^exitEditModeCallback: ^^() => void //^^ Used to re-enable View updates.
|
||||
test: number, // foo bar,
|
||||
exitEditModeCallback: () => void // Used to re-enable View updates.
|
||||
) {
|
||||
^^
|
||||
|
||||
}
|
||||
}
|
||||
-----------------------------------
|
||||
|
|
|
@ -1,27 +1,27 @@
|
|||
original file
|
||||
-----------------------------------
|
||||
export ^^class ^^A ^^extends /* ^^ */^^B ^^implements/**/ ^^C{
|
||||
^^
|
||||
export class A extends /* */B implements/**/ C{
|
||||
|
||||
}
|
||||
^^
|
||||
|
||||
|
||||
export class ^^D ^^implements/**/ ^^ F ^^extends /**/^^G ^^ {
|
||||
^^
|
||||
|
||||
export class D implements/**/ F extends /**/G {
|
||||
|
||||
}
|
||||
^^
|
||||
|
||||
export class ^^E ^^extends /**/^^H ^^ implements/*^^*/ ^^One, ^^Two, ^^Three{
|
||||
^^
|
||||
|
||||
export class E extends /**/H implements/**/ One, Two, Three{
|
||||
|
||||
}
|
||||
^^
|
||||
|
||||
^^class ^^className ^^extends ^^class1 ^^implements ^^class2 {
|
||||
^^
|
||||
|
||||
class className extends class1 implements class2 {
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
Checking comments ^^
|
||||
Checking comments
|
||||
*/
|
||||
|
||||
-----------------------------------
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
original file
|
||||
-----------------------------------
|
||||
^^ var a = 0;
|
||||
^^ var ^^b = ^^1;
|
||||
^^ var ^^c = ^^a ^^^ ^^b;
|
||||
^^
|
||||
var a = 0;
|
||||
var b = 1;
|
||||
var c = a ^ b;
|
||||
|
||||
|
||||
-----------------------------------
|
||||
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
original file
|
||||
-----------------------------------
|
||||
var^^ letter;
|
||||
let^^ variable;
|
||||
var letter;
|
||||
let variable;
|
||||
|
||||
var^^iable;
|
||||
let^^ter;
|
||||
variable;
|
||||
letter;
|
||||
|
||||
var const^^enum^^ = 10;
|
||||
const^^enum^^ += 10;
|
||||
const^^ enum^^ E { }
|
||||
var constenum = 10;
|
||||
constenum += 10;
|
||||
const enum E { }
|
||||
|
||||
var const^^able^^ = "I am rrrrrroyal!";
|
||||
const^^able^^ += " Royal, I say!";
|
||||
var constable = "I am rrrrrroyal!";
|
||||
constable += " Royal, I say!";
|
||||
-----------------------------------
|
||||
|
||||
Grammar: TypeScript.tmLanguage
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
original file
|
||||
-----------------------------------
|
||||
class A {
|
||||
constructor(^^private a: string, ^^protected b: string, ^^public c: string) {
|
||||
constructor(private a: string, protected b: string, public c: string) {
|
||||
}
|
||||
foo() {
|
||||
return this.a + this.b + this.c;
|
||||
|
|
|
@ -3,10 +3,10 @@ original file
|
|||
// Test for https://github.com/Microsoft/TypeScript-Sublime-Plugin/pull/307
|
||||
|
||||
class SomeClass {
|
||||
^^"some string"
|
||||
"some string"
|
||||
}
|
||||
|
||||
var y ^^"some string 2"
|
||||
var y "some string 2"
|
||||
|
||||
|
||||
-----------------------------------
|
||||
|
|
|
@ -2,8 +2,8 @@ original file
|
|||
-----------------------------------
|
||||
class MyComponent extends React.Component<Props, State>{
|
||||
render() {
|
||||
return ^^<^^div ^^onClick={^^this.stop}>
|
||||
^^This is a test: {this.state.count}
|
||||
return <div onClick={this.stop}>
|
||||
This is a test: {this.state.count}
|
||||
</div>
|
||||
}
|
||||
}
|
||||
|
@ -11,28 +11,28 @@ class MyComponent extends React.Component<Props, State>{
|
|||
// JSX in Depth
|
||||
// http://facebook.github.io/react/docs/jsx-in-depth.html
|
||||
var App =
|
||||
^^<^^Form>
|
||||
^^<^^FormRow>
|
||||
^^<^^FormLabel ^^data="^^1" />
|
||||
^^<^^FormInput ^^data="^^2" />
|
||||
^^</^^FormRow>
|
||||
^^</^^Form>
|
||||
<Form>
|
||||
<FormRow>
|
||||
<FormLabel data="1" />
|
||||
<FormInput data="2" />
|
||||
</FormRow>
|
||||
</Form>
|
||||
|
||||
var App2 = (
|
||||
^^<^^Form>
|
||||
^^<^^FormRow>
|
||||
^^<^^FormLabel ^^data='^^1' />
|
||||
^^<^^FormInput ^^data='^^2' />
|
||||
^^</^^FormRow>
|
||||
^^</^^Form>
|
||||
<Form>
|
||||
<FormRow>
|
||||
<FormLabel data='1' />
|
||||
<FormInput data='2' />
|
||||
</FormRow>
|
||||
</Form>
|
||||
)
|
||||
|
||||
var content = (
|
||||
^^<^^Nav>
|
||||
<Nav>
|
||||
{/* child comment, put {} around */}
|
||||
^^<^^Person ^^name={^^window.isLoggedIn ? window.name : ''}
|
||||
^^/>
|
||||
^^</Nav>
|
||||
<Person name={window.isLoggedIn ? window.name : ''}
|
||||
/>
|
||||
</Nav>
|
||||
);
|
||||
|
||||
// JSX Spread Attributes
|
||||
|
@ -40,18 +40,18 @@ var content = (
|
|||
var props = {};
|
||||
props.foo = x;
|
||||
props.bar = y;
|
||||
var component = ^^<^^Component {^^...props} ^^/>;
|
||||
var component = <Component {...props} />;
|
||||
|
||||
var props2 = { foo: 'default' }
|
||||
var component2 = ^^<^^Component {^^...props} foo={'override'} ^^/>
|
||||
var component2 = <Component {...props} foo={'override'} />
|
||||
|
||||
// JSX Gotchas
|
||||
// http://facebook.github.io/react/docs/jsx-gotchas.html
|
||||
var a = <div>{^^'First \u00b7 Second'}</div>
|
||||
var b = <div>{'First ' + ^^String.fromCharCode(183) + ' Second'}</div>
|
||||
var c = <div>{['First ', ^^<span>·</span>, ' Second']}</div>
|
||||
var d = <div dangerouslySetInnerHTML={{^^__html: ^^'First · Second'}} />
|
||||
var e = <div data-custom-attribute="^^foo" />
|
||||
var a = <div>{'First \u00b7 Second'}</div>
|
||||
var b = <div>{'First ' + String.fromCharCode(183) + ' Second'}</div>
|
||||
var c = <div>{['First ', <span>·</span>, ' Second']}</div>
|
||||
var d = <div dangerouslySetInnerHTML={{__html: 'First · Second'}} />
|
||||
var e = <div data-custom-attribute="foo" />
|
||||
|
||||
-----------------------------------
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
original file
|
||||
-----------------------------------
|
||||
^^await 1;
|
||||
^^awaiting 1;
|
||||
await 1;
|
||||
awaiting 1;
|
||||
-----------------------------------
|
||||
|
||||
Grammar: TypeScript.tmLanguage
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
original file
|
||||
-----------------------------------
|
||||
^^switch (x) {
|
||||
^^case 0:
|
||||
^^default:
|
||||
switch (x) {
|
||||
case 0:
|
||||
default:
|
||||
}
|
||||
^^typeof x;
|
||||
^^void x;
|
||||
^^delete x.y;
|
||||
x ^^instanceof y;
|
||||
typeof x;
|
||||
void x;
|
||||
delete x.y;
|
||||
x instanceof y;
|
||||
-----------------------------------
|
||||
|
||||
Grammar: TypeScript.tmLanguage
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
original file
|
||||
-----------------------------------
|
||||
var ^^a, ^^b, ^^c
|
||||
var ^^a1 = 1, ^^b1 = function (x) { return 1; }, ^^c1 = "string"
|
||||
var ^^a2: string = "test", ^^b2: () => void = () => { console.log("hello"); }, ^^c2: string | number;
|
||||
var ^^obj = {
|
||||
var a, b, c
|
||||
var a1 = 1, b1 = function (x) { return 1; }, c1 = "string"
|
||||
var a2: string = "test", b2: () => void = () => { console.log("hello"); }, c2: string | number;
|
||||
var obj = {
|
||||
foo: "10"
|
||||
}, ^^other = 10;
|
||||
}, other = 10;
|
||||
-----------------------------------
|
||||
|
||||
Grammar: TypeScript.tmLanguage
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
original file
|
||||
-----------------------------------
|
||||
^^namespace ts { }
|
||||
^^module ts { }
|
||||
declare ^^namespace ts {}
|
||||
declare ^^module ts {}
|
||||
declare ^^module "x" {}
|
||||
namespace ts { }
|
||||
module ts { }
|
||||
declare namespace ts {}
|
||||
declare module ts {}
|
||||
declare module "x" {}
|
||||
-----------------------------------
|
||||
|
||||
Grammar: TypeScript.tmLanguage
|
||||
|
|
|
@ -1,24 +1,24 @@
|
|||
original file
|
||||
-----------------------------------
|
||||
class Test {
|
||||
^^private ^^data: TemplateData[] = []
|
||||
^^private ^^options: TemplateOptions = {}
|
||||
^^private ^^state = {}
|
||||
private data: TemplateData[] = []
|
||||
private options: TemplateOptions = {}
|
||||
private state = {}
|
||||
}
|
||||
|
||||
^^export ^^type ^^Stats = fs.Stats
|
||||
^^export ^^const ^^touch = thenify(tch)
|
||||
export type Stats = fs.Stats
|
||||
export const touch = thenify(tch)
|
||||
|
||||
/**
|
||||
* Verify comments
|
||||
*/
|
||||
^^export ^^function isFile(path: string): ^^Promise<boolean> {
|
||||
^^return stat(path).then(stat => stat.isFile(), () => false)
|
||||
export function isFile(path: string): Promise<boolean> {
|
||||
return stat(path).then(stat => stat.isFile(), () => false)
|
||||
}
|
||||
|
||||
|
||||
^^export ^^const readFile = thenify<^^string, string, string>(fs.readFile)
|
||||
^^export ^^const writeFile = thenify<^^string, string | Buffer, void>(fs.writeFile)
|
||||
export const readFile = thenify<string, string, string>(fs.readFile)
|
||||
export const writeFile = thenify<string, string | Buffer, void>(fs.writeFile)
|
||||
|
||||
|
||||
-----------------------------------
|
||||
|
|
|
@ -45,6 +45,7 @@ function getScopesAtMarkers(text: string, grammar: vt.IGrammar): { markerScopes:
|
|||
const oriLines = text.split('\n');
|
||||
let ruleStack:vt.StackElement[] = undefined;
|
||||
let outputLines: string[] = [];
|
||||
let cleanLines: string[] = [];
|
||||
let baselineLines: string[] = [];
|
||||
let markers = 0;
|
||||
for (const i in oriLines) {
|
||||
|
@ -55,6 +56,7 @@ function getScopesAtMarkers(text: string, grammar: vt.IGrammar): { markerScopes:
|
|||
let lineTokens = grammar.tokenizeLine(line, ruleStack);
|
||||
ruleStack = lineTokens.ruleStack;
|
||||
|
||||
cleanLines.push(line);
|
||||
outputLines.push(">" + line);
|
||||
baselineLines.push(">" + line);
|
||||
for (let token of lineTokens.tokens) {
|
||||
|
@ -68,11 +70,10 @@ function getScopesAtMarkers(text: string, grammar: vt.IGrammar): { markerScopes:
|
|||
}
|
||||
}
|
||||
|
||||
const oriLineText = getInputFile(oriLines);
|
||||
const grammarInfo = grammar === tsGrammar ? tsGrammarInfo : tsReactGrammarInfo;
|
||||
return {
|
||||
markerScopes: markers ? (oriLineText + grammarInfo + outputLines.join('\n')) : null,
|
||||
wholeBaseline: oriLineText + grammarInfo + baselineLines.join('\n')
|
||||
markerScopes: markers ? (getInputFile(oriLines)+ grammarInfo + outputLines.join('\n')) : null,
|
||||
wholeBaseline: getInputFile(cleanLines)+ grammarInfo + baselineLines.join('\n')
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче