Fixed comments in dtsgen tool
parent
f16f82f208
commit
03b953374f
|
@ -185,7 +185,8 @@ export function generate(file: ts.SourceFile, settings?: Settings) : ts.Node[]{
|
||||||
|
|
||||||
export function print(source: ts.SourceFile, nodes: ts.Node[]) : string {
|
export function print(source: ts.SourceFile, nodes: ts.Node[]) : string {
|
||||||
const printer = ts.createPrinter({
|
const printer = ts.createPrinter({
|
||||||
newLine: ts.NewLineKind.LineFeed
|
newLine: ts.NewLineKind.LineFeed,
|
||||||
|
removeComments: true /* quick fix for comments mess up our target file. May consider to copy comments? (For example a method doc) */
|
||||||
});
|
});
|
||||||
|
|
||||||
return printer.printList(
|
return printer.printList(
|
||||||
|
|
|
@ -0,0 +1,13 @@
|
||||||
|
/// <reference path="A" />
|
||||||
|
/// <reference path="B" />
|
||||||
|
|
||||||
|
abstract class InfoManagerBase { }
|
||||||
|
|
||||||
|
/* Simple test case to fix the "decl" merge bug */
|
||||||
|
/*
|
||||||
|
File: C:\Users\WolverinDEV\TeaSpeak\TeaWeb\tools\dtsgen\test\test_05.ts
|
||||||
|
declare /// <reference path="A" />
|
||||||
|
/// <reference path="B" />
|
||||||
|
abstract class InfoManagerBase {
|
||||||
|
}
|
||||||
|
*/
|
|
@ -1,19 +0,0 @@
|
||||||
function f() {
|
|
||||||
console.log("f(): evaluated");
|
|
||||||
return function (target, propertyKey: string, descriptor: PropertyDescriptor) {
|
|
||||||
console.log("f(): called");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function g() {
|
|
||||||
console.log("g(): evaluated");
|
|
||||||
return function (target, propertyKey: string, descriptor: PropertyDescriptor) {
|
|
||||||
console.log("g(): called");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class C {
|
|
||||||
@f()
|
|
||||||
@g()
|
|
||||||
method() {}
|
|
||||||
}
|
|
Loading…
Reference in New Issue