-
Notifications
You must be signed in to change notification settings - Fork 73
Closed
Description
Hi, first of all thank you for your work :)
I found it confusing and difficult to associate comments with their methods in the current 3.0-prerelease 8 version. Taking as example:
<?php
namespace Foospace\Foo;
/**
* Class description
*/
class FooClass
{
/**
* Description
*/
public static function bar()
{
return $array;
}
/**
* Description
*/
public static function baz()
{
return $array;
}
/**
* Description
*/
public static function woo()
{
return $array;
}
}
the AST explorer will render something like this:
// class body
[
{
"kind": "method",
"leadingComments": [...],
"body": {
"trailingComments": [...],
},
...
},
{
"kind": "method",
"body": {
"trailingComments": [...],
},
...
},
{
"kind": "method",
"body": {
"trailingComments": [...],
},
...
}
]
The confusing part is that the trailing comments are part of the method body, which is not accurate.
And I would expect each method to have it leadingComments as the first one in order to access them easier.