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

Adding support for included files and classes (this)

Open mlpo opened this issue 9 years ago • 11 comments

Hi! It would be great to support included files (that is to say import the functions, classes, methods and variables of included files).

For classes, it would also be good to support the keyword "this" to automatically find the local attributes of the current class. The same functionality could perhaps be added to the objects.

To make it more clear: atomthisphp Show local attribute "path".

classincludesupport Show "Repository" class that comes from the included file.

methods Show "showMessage" a method of the class that comes from the included file.

In the same vein, it would be great to autocomplete (as an IDE) multiple calls between multiple files (files being linked with namespaces or with include keyword). For example: $myObject->getManager()->getClients().

Anyway, the plugin is already great.

mlpo avatar May 12 '15 17:05 mlpo

I just came across the issue #7 that already partially meets mine.

mlpo avatar May 12 '15 17:05 mlpo

Yeah, in some part is the same of the issue #7 but maybe i can do something with the keyword "this" but i can't promise nothing. for now you will have to wait because like i say in the other issue now i want to polish the functionality that already exist

Azakur4 avatar May 12 '15 19:05 Azakur4

@Azakur4 I suggest to use https://github.com/atom/symbols-view as it can help you a lot on this.

aitboudad avatar May 13 '15 20:05 aitboudad

@aitboudad I reviewed before but the symbols view doesn't work very will in php but i will give a view again to see maybe im wrong.

thanks anyway.

Azakur4 avatar May 13 '15 20:05 Azakur4

@Azakur4 It's mainly based on ctags there are many packages that use symbols-view or just got inspiration like

  • https://github.com/xndcn/symbols-tree-view
  • https://github.com/yongkangchen/atom-ctags

thanks for the great work :+1:

aitboudad avatar May 13 '15 20:05 aitboudad

oh i will review that 2 packages to see if i can get some ideas maybe get something that i can improve here, thanks man.

Azakur4 avatar May 13 '15 20:05 Azakur4

I found another package similar to this one seems doesn't yet published: https://github.com/Peekmo/atom-autocomplete-php but it's more advanced as I see if you work together to provide one package it wood be awesome

aitboudad avatar May 15 '15 20:05 aitboudad

i see that package and he is working tu support autocomplete for object and classes inside a project and to me superficially appear like phpintel for sublime do but for the moment like i say before im only focus in get the actually package working well with no erros that is my first goal i don't know if i will work in support autocomplete for objects.

I know that have that help for a php developer is something very nice and helps a lot but to be honest with u the state of this package at this moment is a very good help to me.

In the #7 issue i talk about this. is something that i like to have but i see how it works the autocomplete and i see that u need analise all code to generate a suggestion list.

I'm not trying to say that i will not work on that but at the moment is something that i not have in my todo.

That package was created before that my and i release my package only because i don't want process a lot of php code to generate the suggestion list or wait a lot to generate a list of suggestions and recreated between minutes or something like that. My idea was get a simple autocomplete that get a fast help with no optional config file and doesn't consume a lot external process.

Azakur4 avatar May 16 '15 01:05 Azakur4

@Azakur4 yes I understand :) keep it simple is better than having many of features which is difficult to maintain IMO.

aitboudad avatar May 16 '15 14:05 aitboudad

Is something like that, not is keep it simple is keep it fast and functional to me. if in near future i think in a good solution and fast trust in me i will implement that here i will love to have this in the package :)

Azakur4 avatar May 16 '15 20:05 Azakur4

What @mlpo is saying is awesome... I want this mostly for PHP projects like working on a Laravel project... It's something that is really needed... I have installed Ctags package successfully but it doesn't do anything! I don't know, maybe I'm doing something wrong or expecting it to do something that it cannot do!

Here is what I'm looking for: I want to see the available methods and properties of a PHP class that I myself have written! Is it possible with Ctags or Symbols-view packages? Or something else that is out there and I don't know about?

Any guidance to shade some light is so much appreciated.

imalitavakoli avatar Jul 01 '15 06:07 imalitavakoli