Fix flow comments plugin issues (#10329)
* Fix issues in flow-comments to preserve comments and there order (fixes #10324) * Add support in flow-comments for extends in class declarations (fixes #10323, #10321) * Refactoring and cleanup of flow-comments plugin * Fix comments preservation logic of flow-comments * Fix flow-comments where comments are class identifier and extends keyword
This commit is contained in:
committed by
Nicolò Ribaudo
parent
469a5a71cd
commit
64041e1669
@@ -0,0 +1 @@
|
||||
class Foo extends Bar<T> {}
|
||||
@@ -0,0 +1,3 @@
|
||||
class Foo extends Bar
|
||||
/*:: <T>*/
|
||||
{}
|
||||
@@ -0,0 +1,3 @@
|
||||
class Foo<T> /* inner */ extends Bar<R> {}
|
||||
|
||||
/*a*/class /*b*/Baz/*c*/<T>/*d*/extends /*e*/Bar/*f*/<R>/*g*/ {/*h*/}/*i*/
|
||||
@@ -0,0 +1,30 @@
|
||||
class Foo
|
||||
/*:: <T>*/
|
||||
|
||||
/* inner */
|
||||
extends Bar
|
||||
/*:: <R>*/
|
||||
{}
|
||||
/*a*/
|
||||
|
||||
|
||||
class
|
||||
/*b*/
|
||||
Baz
|
||||
/*c*/
|
||||
|
||||
/*:: <T>*/
|
||||
|
||||
/*d*/
|
||||
extends
|
||||
/*e*/
|
||||
Bar
|
||||
/*f*/
|
||||
|
||||
/*:: <R>*/
|
||||
|
||||
/*g*/
|
||||
{}
|
||||
/*h*/
|
||||
|
||||
/*i*/
|
||||
@@ -0,0 +1 @@
|
||||
class Foo<T> extends Bar {}
|
||||
@@ -0,0 +1,3 @@
|
||||
class Foo
|
||||
/*:: <T>*/
|
||||
extends Bar {}
|
||||
@@ -0,0 +1,7 @@
|
||||
/*a*/
|
||||
type Foo = number;
|
||||
/*b*/
|
||||
var foo;
|
||||
/*c*/
|
||||
type Bar = number;
|
||||
/*d*/
|
||||
@@ -0,0 +1,11 @@
|
||||
/*a*/
|
||||
|
||||
/*:: type Foo = number;*/
|
||||
|
||||
/*b*/
|
||||
var foo;
|
||||
/*c*/
|
||||
|
||||
/*:: type Bar = number;*/
|
||||
|
||||
/*d*/
|
||||
@@ -0,0 +1,2 @@
|
||||
/**/
|
||||
type Foo = number;
|
||||
@@ -0,0 +1,3 @@
|
||||
/**/
|
||||
|
||||
/*:: type Foo = number;*/
|
||||
Reference in New Issue
Block a user