diff --git a/tests/baselines/Abstracts.baseline.txt b/tests/baselines/Abstracts.baseline.txt index 38c1ca9..e4a0ae0 100644 --- a/tests/baselines/Abstracts.baseline.txt +++ b/tests/baselines/Abstracts.baseline.txt @@ -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 { diff --git a/tests/baselines/ArrowFunctionInsideTypeAssertion.baseline.txt b/tests/baselines/ArrowFunctionInsideTypeAssertion.baseline.txt index 7ef39c5..e7ac75f 100644 --- a/tests/baselines/ArrowFunctionInsideTypeAssertion.baseline.txt +++ b/tests/baselines/ArrowFunctionInsideTypeAssertion.baseline.txt @@ -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") } } diff --git a/tests/baselines/Comments.baseline.txt b/tests/baselines/Comments.baseline.txt index 899473d..d79d84b 100644 --- a/tests/baselines/Comments.baseline.txt +++ b/tests/baselines/Comments.baseline.txt @@ -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^^/**/ extends Array { 0: K; 1: V; } -interface KeyValuePair^^/**/extends Array { 0: K; 1: V; } -interface KeyValuePair extends^^/**/Array { 0: K; 1: V; } -interface KeyValuePair extends Array^^/**/ { 0: K; 1: V; } -interface KeyValuePair extends Array^^/**/{ 0: K; 1: V; } +interface KeyValuePair/**/ extends Array { 0: K; 1: V; } +interface KeyValuePair/**/extends Array { 0: K; 1: V; } +interface KeyValuePair extends/**/Array { 0: K; 1: V; } +interface KeyValuePair extends Array/**/ { 0: K; 1: V; } +interface KeyValuePair extends Array/**/{ 0: K; 1: V; } -interface G^^/**/ { +interface G/**/ { f(x: V): V; } -interface G { +interface G { f(x: V): V; } -interface G { +interface G { f(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 diff --git a/tests/baselines/FunctionMethodOverloads.baseline.txt b/tests/baselines/FunctionMethodOverloads.baseline.txt index 874067a..57ef4fd 100644 --- a/tests/baselines/FunctionMethodOverloads.baseline.txt +++ b/tests/baselines/FunctionMethodOverloads.baseline.txt @@ -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() } ----------------------------------- diff --git a/tests/baselines/FunctionMethodParameters.baseline.txt b/tests/baselines/FunctionMethodParameters.baseline.txt index 186e96e..2159397 100644 --- a/tests/baselines/FunctionMethodParameters.baseline.txt +++ b/tests/baselines/FunctionMethodParameters.baseline.txt @@ -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, - ^^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, + 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, - ^^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, + m8: [number, number], + m9: {a: A, b: B} | [number, number], + m10: (() => void) | string[]): number { + return m6.length; } } ----------------------------------- diff --git a/tests/baselines/FunctionMethodReturnTypes.baseline.txt b/tests/baselines/FunctionMethodReturnTypes.baseline.txt index e50e877..cc46e6c 100644 --- a/tests/baselines/FunctionMethodReturnTypes.baseline.txt +++ b/tests/baselines/FunctionMethodReturnTypes.baseline.txt @@ -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 { ^^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 { 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 { ^^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 { 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 [""] } } ----------------------------------- diff --git a/tests/baselines/Issue110.baseline.txt b/tests/baselines/Issue110.baseline.txt index adf5939..210d318 100644 --- a/tests/baselines/Issue110.baseline.txt +++ b/tests/baselines/Issue110.baseline.txt @@ -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 */ ----------------------------------- diff --git a/tests/baselines/Issue124.baseline.txt b/tests/baselines/Issue124.baseline.txt index ef4bd76..f2aed1f 100644 --- a/tests/baselines/Issue124.baseline.txt +++ b/tests/baselines/Issue124.baseline.txt @@ -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 */ ----------------------------------- diff --git a/tests/baselines/Issue149.baseline.txt b/tests/baselines/Issue149.baseline.txt index a961ea6..072e653 100644 --- a/tests/baselines/Issue149.baseline.txt +++ b/tests/baselines/Issue149.baseline.txt @@ -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 ""; } ----------------------------------- diff --git a/tests/baselines/Issue156.baseline.txt b/tests/baselines/Issue156.baseline.txt index eaf8b49..3835f8b 100644 --- a/tests/baselines/Issue156.baseline.txt +++ b/tests/baselines/Issue156.baseline.txt @@ -1,9 +1,9 @@ original file ----------------------------------- class Test { - ^^mmm(^^p1: ^^string | ^^{}, ^^p2: ^^string) + mmm(p1: string | {}, p2: string) { - ^^ + } } ----------------------------------- diff --git a/tests/baselines/Issue191.baseline.txt b/tests/baselines/Issue191.baseline.txt index 989d9fc..f648730 100644 --- a/tests/baselines/Issue191.baseline.txt +++ b/tests/baselines/Issue191.baseline.txt @@ -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(); + 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 { + constructor(public content: string){ + var prop = Q.defer(); + this.store = new Data(); + gaze(path.join(this.content, "**/*.json"), (err, watch) => { + process.stuout.write(`Watching for changes in:`); }) }; } diff --git a/tests/baselines/Issue200.baseline.txt b/tests/baselines/Issue200.baseline.txt index ef23c2b..01910df 100644 --- a/tests/baselines/Issue200.baseline.txt +++ b/tests/baselines/Issue200.baseline.txt @@ -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 diff --git a/tests/baselines/Issue208.baseline.txt b/tests/baselines/Issue208.baseline.txt index 8058d9b..d1a3370 100644 --- a/tests/baselines/Issue208.baseline.txt +++ b/tests/baselines/Issue208.baseline.txt @@ -1,14 +1,14 @@ original file ----------------------------------- -var someVar = ^^new ^^Thing<^^number, ^^string>('^^data'^^); -var someVar = ^^makeThing<^^number, ^^string>('^^data'^^); +var someVar = new Thing('data'); +var someVar = makeThing('data'); class MyClass { - static ^^someProp = new ^^Thing<^^number, ^^string>('data'); - static ^^someProp = ^^makeThing<^^number, ^^string>('data'); + static someProp = new Thing('data'); + static someProp = makeThing('data'); - someProp = new ^^Thing<^^number, ^^string>('data'); - someProp = ^^makeThing<^^number, ^^string>('data'); + someProp = new Thing('data'); + someProp = makeThing('data'); } ----------------------------------- diff --git a/tests/baselines/Issue262.baseline.txt b/tests/baselines/Issue262.baseline.txt index efa442b..917b6b0 100644 --- a/tests/baselines/Issue262.baseline.txt +++ b/tests/baselines/Issue262.baseline.txt @@ -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++) { + } } ----------------------------------- diff --git a/tests/baselines/Issue28.baseline.txt b/tests/baselines/Issue28.baseline.txt index a166a48..c1459ae 100644 --- a/tests/baselines/Issue28.baseline.txt +++ b/tests/baselines/Issue28.baseline.txt @@ -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 diff --git a/tests/baselines/Issue288.baseline.txt b/tests/baselines/Issue288.baseline.txt index dca50a3..ec93ef6 100644 --- a/tests/baselines/Issue288.baseline.txt +++ b/tests/baselines/Issue288.baseline.txt @@ -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; ----------------------------------- diff --git a/tests/baselines/Issue32.baseline.txt b/tests/baselines/Issue32.baseline.txt index 1fbc0f8..62c826e 100644 --- a/tests/baselines/Issue32.baseline.txt +++ b/tests/baselines/Issue32.baseline.txt @@ -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 */ diff --git a/tests/baselines/Issue335.baseline.txt b/tests/baselines/Issue335.baseline.txt index ff02bde..12c61da 100644 --- a/tests/baselines/Issue335.baseline.txt +++ b/tests/baselines/Issue335.baseline.txt @@ -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() { } } ----------------------------------- diff --git a/tests/baselines/Issue37.baseline.txt b/tests/baselines/Issue37.baseline.txt index e3eae3e..6a74073 100644 --- a/tests/baselines/Issue37.baseline.txt +++ b/tests/baselines/Issue37.baseline.txt @@ -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 */ diff --git a/tests/baselines/Issue44.baseline.txt b/tests/baselines/Issue44.baseline.txt index 693d715..0d9f27c 100644 --- a/tests/baselines/Issue44.baseline.txt +++ b/tests/baselines/Issue44.baseline.txt @@ -1,10 +1,10 @@ original file ----------------------------------- -^^interface ^^TestInterface { - ^^testvar: ^^string; - ^^testfunc(): ^^string; -^^} +interface TestInterface { + testvar: string; + testfunc(): string; +} /* Testing Comments diff --git a/tests/baselines/Issue5.baseline.txt b/tests/baselines/Issue5.baseline.txt index 907ea29..0f5ad69 100644 --- a/tests/baselines/Issue5.baseline.txt +++ b/tests/baselines/Issue5.baseline.txt @@ -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" + ----------------------------------- diff --git a/tests/baselines/Issue63.baseline.txt b/tests/baselines/Issue63.baseline.txt index 3c12972..251cef1 100644 --- a/tests/baselines/Issue63.baseline.txt +++ b/tests/baselines/Issue63.baseline.txt @@ -1,19 +1,19 @@ original file ----------------------------------- -^^type ^^Callback <^^T> = ^^(error: Error, value: T) => any +type Callback = (error: Error, value: T) => any -^^type Callback^^ = ^^(error: Error, value: T) ^^=> ^^any +type Callback = (error: Error, value: T) => any -type Callback = ^^(error: Error, value: T) => ^^any +type Callback = (error: Error, value: T) => any -^^type ^^Callback^^ ^^void> = ^^(error: Error, value: T) => ^^any +type Callback void> = (error: Error, value: T) => any -^^ type ^^Foo <^^T > = ^^{ + type Foo = { - ^^foo: ^^T, - ^^bar: ^^number + foo: T, + bar: number -^^} +} ----------------------------------- Grammar: TypeScript.tmLanguage diff --git a/tests/baselines/Issue82.baseline.txt b/tests/baselines/Issue82.baseline.txt index 6576222..ecf22e8 100644 --- a/tests/baselines/Issue82.baseline.txt +++ b/tests/baselines/Issue82.baseline.txt @@ -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. ) { - ^^ + } } ----------------------------------- diff --git a/tests/baselines/Issue89.baseline.txt b/tests/baselines/Issue89.baseline.txt index ba029db..114cf50 100644 --- a/tests/baselines/Issue89.baseline.txt +++ b/tests/baselines/Issue89.baseline.txt @@ -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 */ ----------------------------------- diff --git a/tests/baselines/Issue90.baseline.txt b/tests/baselines/Issue90.baseline.txt index c906b86..41fcdb4 100644 --- a/tests/baselines/Issue90.baseline.txt +++ b/tests/baselines/Issue90.baseline.txt @@ -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; + ----------------------------------- diff --git a/tests/baselines/Issue96.baseline.txt b/tests/baselines/Issue96.baseline.txt index f52f01d..b3f3001 100644 --- a/tests/baselines/Issue96.baseline.txt +++ b/tests/baselines/Issue96.baseline.txt @@ -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 diff --git a/tests/baselines/ParameterProperties.baseline.txt b/tests/baselines/ParameterProperties.baseline.txt index 0888b2b..83d14a4 100644 --- a/tests/baselines/ParameterProperties.baseline.txt +++ b/tests/baselines/ParameterProperties.baseline.txt @@ -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; diff --git a/tests/baselines/SyntacticallyIncorrectStrings.baseline.txt b/tests/baselines/SyntacticallyIncorrectStrings.baseline.txt index 3ac0b2c..b13869c 100644 --- a/tests/baselines/SyntacticallyIncorrectStrings.baseline.txt +++ b/tests/baselines/SyntacticallyIncorrectStrings.baseline.txt @@ -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" ----------------------------------- diff --git a/tests/baselines/TsxSamples.baseline.txt b/tests/baselines/TsxSamples.baseline.txt index e0f30c3..93e9c23 100644 --- a/tests/baselines/TsxSamples.baseline.txt +++ b/tests/baselines/TsxSamples.baseline.txt @@ -2,8 +2,8 @@ original file ----------------------------------- class MyComponent extends React.Component{ render() { - return ^^<^^div ^^onClick={^^this.stop}> - ^^This is a test: {this.state.count} + return
+ This is a test: {this.state.count}
} } @@ -11,28 +11,28 @@ class MyComponent extends React.Component{ // JSX in Depth // http://facebook.github.io/react/docs/jsx-in-depth.html var App = - ^^<^^Form> - ^^<^^FormRow> - ^^<^^FormLabel ^^data="^^1" /> - ^^<^^FormInput ^^data="^^2" /> - ^^ - ^^ +
+ + + + +
var App2 = ( - ^^<^^Form> - ^^<^^FormRow> - ^^<^^FormLabel ^^data='^^1' /> - ^^<^^FormInput ^^data='^^2' /> - ^^ - ^^ +
+ + + + +
) var content = ( - ^^<^^Nav> + + + ); // JSX Spread Attributes @@ -40,18 +40,18 @@ var content = ( var props = {}; props.foo = x; props.bar = y; -var component = ^^<^^Component {^^...props} ^^/>; +var component = ; var props2 = { foo: 'default' } -var component2 = ^^<^^Component {^^...props} foo={'override'} ^^/> +var component2 = // JSX Gotchas // http://facebook.github.io/react/docs/jsx-gotchas.html -var a =
{^^'First \u00b7 Second'}
-var b =
{'First ' + ^^String.fromCharCode(183) + ' Second'}
-var c =
{['First ', ^^·, ' Second']}
-var d =
-var e =
+var a =
{'First \u00b7 Second'}
+var b =
{'First ' + String.fromCharCode(183) + ' Second'}
+var c =
{['First ', ·, ' Second']}
+var d =
+var e =
----------------------------------- diff --git a/tests/baselines/awaitColoring.baseline.txt b/tests/baselines/awaitColoring.baseline.txt index 9d527bb..ac2b17f 100644 --- a/tests/baselines/awaitColoring.baseline.txt +++ b/tests/baselines/awaitColoring.baseline.txt @@ -1,7 +1,7 @@ original file ----------------------------------- -^^await 1; -^^awaiting 1; +await 1; +awaiting 1; ----------------------------------- Grammar: TypeScript.tmLanguage diff --git a/tests/baselines/javascript.baseline.txt b/tests/baselines/javascript.baseline.txt index 330b180..4a92197 100644 --- a/tests/baselines/javascript.baseline.txt +++ b/tests/baselines/javascript.baseline.txt @@ -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 diff --git a/tests/baselines/multipleVariableDeclaration.baseline.txt b/tests/baselines/multipleVariableDeclaration.baseline.txt index a5ee813..423985e 100644 --- a/tests/baselines/multipleVariableDeclaration.baseline.txt +++ b/tests/baselines/multipleVariableDeclaration.baseline.txt @@ -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 diff --git a/tests/baselines/namespaceAndModule.baseline.txt b/tests/baselines/namespaceAndModule.baseline.txt index 4712140..f08bcba 100644 --- a/tests/baselines/namespaceAndModule.baseline.txt +++ b/tests/baselines/namespaceAndModule.baseline.txt @@ -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 diff --git a/tests/baselines/pr48_noSemiColon.baseline.txt b/tests/baselines/pr48_noSemiColon.baseline.txt index 5d1cda2..d572da1 100644 --- a/tests/baselines/pr48_noSemiColon.baseline.txt +++ b/tests/baselines/pr48_noSemiColon.baseline.txt @@ -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 { - ^^return stat(path).then(stat => stat.isFile(), () => false) +export function isFile(path: string): Promise { + 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(fs.readFile) +export const writeFile = thenify(fs.writeFile) ----------------------------------- diff --git a/tests/build.ts b/tests/build.ts index 1128435..d2afa97 100644 --- a/tests/build.ts +++ b/tests/build.ts @@ -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') }; }