You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Assume the cursor is in the '<>' position. It would be great if PHPActor would be able to navigate (and, ideally, support all other features like context menu from that point) to As definition, like it can when A is referenced in executable code.
Have been looking at this, it's tricky. In order to do it properly we need to be able to reflect the docblock itself (f.e. using the phpstan docblock parser). This means injecting more responsiblity into WorseReflection, and the current architecture isn't very open to this.
We could do this in a naieve way the Phpactor GotoDefinition code: if the Symbol type is <unknown> then assume that the current word is a class name and resolve that to an FQN (there is some functionality exposed for this purpose from WR). Additionally it might be reasonable for WR to flag if a given offset is whitespace / comments.
That would probably be enough. I don't see myself doing renames and other stuff from docblock. I've grown accustomed to the menu though, so would appreciate if it would work as well, even if it has only go to definition entry.
Activity
dantleech commentedon Jun 8, 2018
Yep, will probably need to enable this in WorseReflection.
dantleech commentedon Jun 9, 2018
Have been looking at this, it's tricky. In order to do it properly we need to be able to reflect the docblock itself (f.e. using the phpstan docblock parser). This means injecting more responsiblity into WorseReflection, and the current architecture isn't very open to this.
We could do this in a naieve way the Phpactor GotoDefinition code: if the Symbol type is
<unknown>then assume that the current word is a class name and resolve that to an FQN (there is some functionality exposed for this purpose from WR). Additionally it might be reasonable for WR to flag if a given offset is whitespace / comments.weirdan commentedon Jun 9, 2018
That would probably be enough. I don't see myself doing renames and other stuff from docblock. I've grown accustomed to the menu though, so would appreciate if it would work as well, even if it has only go to definition entry.
dantleech commentedon Dec 21, 2018
This was done in #679