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:
Ziad El Khoury Hanna
2019-08-14 15:46:26 +02:00
committed by Nicolò Ribaudo
parent 469a5a71cd
commit 64041e1669
11 changed files with 222 additions and 88 deletions

View File

@@ -0,0 +1 @@
class Foo extends Bar<T> {}

View File

@@ -0,0 +1,3 @@
class Foo extends Bar
/*:: <T>*/
{}

View File

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

View File

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

View File

@@ -0,0 +1 @@
class Foo<T> extends Bar {}

View File

@@ -0,0 +1,3 @@
class Foo
/*:: <T>*/
extends Bar {}

View File

@@ -0,0 +1,7 @@
/*a*/
type Foo = number;
/*b*/
var foo;
/*c*/
type Bar = number;
/*d*/

View File

@@ -0,0 +1,11 @@
/*a*/
/*:: type Foo = number;*/
/*b*/
var foo;
/*c*/
/*:: type Bar = number;*/
/*d*/

View File

@@ -0,0 +1,2 @@
/**/
type Foo = number;

View File

@@ -0,0 +1,3 @@
/**/
/*:: type Foo = number;*/