phpactor.el icon indicating copy to clipboard operation
phpactor.el copied to clipboard

show php function documentation upon completion

Open kermorgant opened this issue 6 years ago • 2 comments

during completion, we rely on phpactor's output to show extra information (such as FQN) for each completion candidate, using company's annotation function.

company provides other ways to give contextual help for each candidate. Here's an extract from its source

meta: The second argument is a completion candidate. Return a (short) documentation string for it.

doc-buffer: The second argument is a completion candidate. Return a buffer with documentation for it. Preferably use `company-doc-buffer'. If not all buffer contents pertain to this candidate, return a cons of buffer and window start position.

It would be nice to use php's documentation when completion candidates are php functions (maybe using php-mode's php-search-local-documentation function ?)

kermorgant avatar Sep 25 '18 06:09 kermorgant

I think it would be better to use the candidate's doc-comment to generate the annotation - this way it'll work for user-defined functions as well as built-ins (which are provided by the jetbrains/phpstorm-stubs library)

MarTango avatar Sep 25 '18 08:09 MarTango

@MarTango you mean generate the content for meta, no ? annotation is already used and populated with details from phpactor.

That said, I think what you mention does not exclude what I proposed as I believe phpactor now gives more details for each candidate and we'll know whether the candidate is a native php function or a user defined one (worth a check to be sure).

kermorgant avatar Sep 25 '18 09:09 kermorgant