-
Notifications
You must be signed in to change notification settings - Fork 310
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 class name #539
Comments
it is possible to autocomplete class names if (1) you’re using a readline implementation which supports autocomplete and (2) you’ve already autoloaded the file that defines that class. |
Thank you for response! Does fuzzy search work?
I came from PhpStorm and I don't remember namespace name of each class 😄 |
@bobthecow so what is the missing part for the auto-completion? Loading all the code we potentially want to auto-complete? |
@theofidry i've been kicking around the idea of "autoload warmers" for a while. wanna make one? 😄 i imagine it would be an interface, and maybe a couple of implementations. one based on composer, that reads either configs or generated autoloaders, uses them to enumerate all possible classes. another could be symfony finder based, and walk the filesystem according to the finder rules. in all cases, we probably just want them to emit a list of files which possibly / probably contain classes, then use php parser to parse the file and make sure (1) it's valid PHP and won't error, (2) it contains only class and function definitions at the top level, not things that probably have side effects. |
I suspect that #571 could be closed in favor of this, if I'm reading this correctly. :) I've done some experimenting on my own and have been able to make a lot of my classes available but it seems to not bring interfaces in. It finds them, it calls I may be interested in trying to get the autoload warmers implemented if I had some vague high-level direction to go in... unless @theofidry is already on it? :) |
Unfortunately, I've been a bit too busy this last year so I'm more focusing on trying to keep a few of my OSS projects alive and not start something new :) |
@simensen Yes, do it! I don't have strong opinions on what it looks like. Probably something similar to how we do autocomplete matchers, where you can use config to register your own, or projects like Laravel Tinker can provide more specific implementations, but we ship with some reasonable defaults that will work for most cases. I'd guess: one implementation that takes Symfony Finder-style paths (or a Finder instance itself), one implementation that uses the project's composer autoload config, and one implementation that handles |
Unfortunately, no, due to limitations in readline. It strips out completions that don't match the current input, so even if we provided |
Moving the "autoload warmers" bit to a proper issue (#650) and closing this one as "wontfix", because the remainder of the ticket isn't possible. Thanks readline! |
Thank you for amazing tool! 👍
I would be awesome to autocomplete namespaces:
Is it possible right now? I can try to create PR if needed 😄
The text was updated successfully, but these errors were encountered: