Better project and OOP hinting


#1

My current favourite is PHPStorm for it’s solid hinting/auto-completion — something I’m missing in Atom or any of the packages that supposedly improves hinting.

Is there a package available that will index the project and suggests better, more accurate hints? It does seem to list all methods in a class for example and suggest that first, but it also suggest a lot of other functions that are completely irrelevant.

PHPStorm: click here
Atom: click here

I can’t post images as new user.

Of course, Atom is intended to be a minimal editor and all, and indexing and accurate hinting can impact performance a little, but it really helps when you’re using libraries you may not be familiar with.


#2

That’s the autocomplete package, reporting the issue there helps more than just discussing it here.

Here is the link of the autocomplete repo https://github.com/atom/autocomplete


#3

To achieve something like PHPStorm would be less than trivial - you would need to actually parse and analyze PHP code, which is way beyond the scope of the autocomplete package, as far as I can tell (?)

Perhaps the simplest/safest way to create something like this, would be to literally let PHP do the heavy lifting - writing a source code analyzer in PHP itself would be fairly easy, as it has the tokenizer built in.

I have a fair bit of experience working with the PHP tokenizer, parsing/generating/transforming PHP code, etc. - I could play the part of writing a PHP-based language analysis service that would deliver e.g. a JSON description of the source code for a PHP-specific auto-completer to consume. If somebody else is interested in writing the actual ATOM plugin, we might could work something out.