Fixed comments in dtsgen tool

canary
WolverinDEV 2019-08-21 13:13:00 +02:00
parent f16f82f208
commit 03b953374f
3 changed files with 15 additions and 20 deletions

View File

@ -185,7 +185,8 @@ export function generate(file: ts.SourceFile, settings?: Settings) : ts.Node[]{
export function print(source: ts.SourceFile, nodes: ts.Node[]) : string {
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(

View File

@ -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 {
}
*/

View File

@ -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() {}
}