autocomplete-php icon indicating copy to clipboard operation
autocomplete-php copied to clipboard

Doesn't show suggestions for member variables

Open olssonm opened this issue 9 years ago • 9 comments

Having some major issues with autocomplete-php enabled, where I don't get already used member variables as a suggestion. However, with autocomplete-php disabled it works as it should. Example:

screen shot 2015-06-02 at 09 43 42 autocomplete-php enabled, should suggest "no_of_clicks" (doesn't even show up as an option)

screen shot 2015-06-02 at 09 44 04 autocomplete-php disabled, suggests the variable "no_of_clicks" just as it should

Is this a known issue?

Great package otherwise, just what I have been looking for (trying to migrate from Sublime Text where all this works flawlessly out of the box).

autocomplete-php v0.3.6 Atom v0.204.0

olssonm avatar Jun 02 '15 07:06 olssonm

i know that, actually my package doesn't support for methods inside an object. Im still thinking how get that functionality here and i think im close to found a way.

Azakur4 avatar Jun 02 '15 12:06 Azakur4

Sounds cool, and that sure would be a great feature!

The problem here though is that using autocomplete-php trades the ability to autocomplete "already written" strings, for the snippets, functions and variables that autocomplete-php provides.

olssonm avatar Jun 02 '15 15:06 olssonm

Yes that happens the problem with that was that the built in provider show variables twice one for the php suggestion and another for the built in provider, was for that was disabled.

Azakur4 avatar Jun 02 '15 15:06 Azakur4

Ah, gotcha – thanks for the clarification.

olssonm avatar Jun 02 '15 15:06 olssonm

Well, there is always the Padawan project, which is an auto completion server for PHP [1]. It may however not be interesting as you may be looking to keep the plugin self-contained; in the case of Padawan you'd have to turn the plugin into something that spawns a Padawan server for each Atom project and then sends a request to it to ask for autocompletion information (the plugin would do nothing more than ask the server for information).

[1] https://github.com/mkusher/padawan.php

ghost avatar Jun 04 '15 18:06 ghost

Umm hi @MineyMe, i never see that padawan. i will go see that php server maybe we can integrate here.

Azakur4 avatar Jun 05 '15 23:06 Azakur4

only for update this i make a branch using padawan to get a better autocompletion for user classes and all the stuff but actually padawan need a lot of work and im a little off with time. I talk with the owner of the project padawan to try to help him to make it better and work on it but im still with open mind an always trying to find a better solution.

Azakur4 avatar Jul 06 '15 14:07 Azakur4

There is also another PHP autocompletion plugin for Atom [1]. I also suggested Padawan there as I seems to work in the same line (using Composer to fetch a class map) but instead of using an entirely different server it only depends on Atom, PHP and Composer and builds the index locally (and the developer wishes to keep it that way). I know however that even though everyone likes a joint effort, it is not always possible ;-).

[1] https://github.com/Peekmo/atom-autocomplete-php

ghost avatar Jul 06 '15 18:07 ghost

Hello,

In fact, my plugin does not depend on any PHP server and all my completions (except classes list) are done "on the fly". Many features are already supported :

  • static/const completion
  • $this completion
  • parent / self completion
  • new ... completion
  • local variable completion
  • and on a new branch (https://github.com/Peekmo/atom-autocomplete-php/tree/autocomplete) completion on all variables is done. (support multiline also)

There's probably some bugs and there is and there will be some specific cases that the autocompletion will not work, because it's very hard to parse PHP, but I think that it's already not bad at all. If you want to join the effort, you're welcome :)

Peekmo avatar Jul 09 '15 07:07 Peekmo