Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autocomplete namespaces from project #108

Open
alexdrupal opened this issue Mar 31, 2018 · 1 comment
Open

Autocomplete namespaces from project #108

alexdrupal opened this issue Mar 31, 2018 · 1 comment

Comments

@alexdrupal
Copy link

Hello

First of all, thank you so much for the plugin. It works really well.
However I'm missing two things. When I work on symfony project and import classes via use \namespace1\namespace2 - autocompletion works perfectly, but sometimes I don't know where the class is and it would be nice to type just the class name and a to be able to see a list of namespaces where class with such name exists.
Possible?

Also another option I'm missing is namespace autocompletion from project tags file.
I'm using phpctags to generate my tags.

Thanks!

@complex857
Copy link
Collaborator

Hi

I believe the first scenario is doable albeit could be slow (well, what's isn't slow with this plugin 😅)
In the tag files you've the following type of information for classes:

Level31	foo_inheritance_level31.php	/^class Level31 {$/;"	c	namespace:NS31\SubNS

The thing you can search for with pattern matching is the first column, however once you've the results you've access to the namespace:... part. The only thing is that so far the philosophy was that we tried to be accurate with the responses and/or touching the already typed in base could be annoying, but i believe it's doable (might wanna hide it behind some settings value).

As for namespace completion: I believe we already do something similar around the use ... context, you'll get namespace suggestions already (altho it won't search in tags without you typing in at least one letter). I'm not sure what exact context you mean for this one. The tags database do contain all the namespaces as individual items, so the raw data is there.

Sorry, for the late reply.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants