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

Tab completion not finding all custom classes #571

Closed
simensen opened this issue Sep 26, 2019 · 3 comments
Closed

Tab completion not finding all custom classes #571

simensen opened this issue Sep 26, 2019 · 3 comments

Comments

@simensen
Copy link

Unclear if this is related to #561 or not, but new classes added to my project are not showing up as tab completion targets. I'm able to reference the classes directly by their FQCN so I know the autoloading is configured and working correctly. I just can't see them as options when tab completing.

I've tried composer dump-autoload in case that might matter but it doesn't seem to have any impact. I've seen other people asked to include \psy\info() so I'm including that here. Happy to provide anything else that might help debug this.

Psy Shell v0.9.9 (PHP 7.3.7 — cli) by Justin Hileman
>>> \psy\info()
=> [
     "PsySH version" => "v0.9.9",
     "PHP version" => "7.3.7",
     "OS" => "Darwin",
     "default includes" => [],
     "require semicolons" => false,
     "error logging level" => 32767,
     "config file" => [
       "default config file" => "~/.config/psysh/config.php",
       "local config file" => null,
       "PSYSH_CONFIG env" => false,
     ],
     "loop listeners" => [],
     "commands" => [
       "help" => "Psy\Command\HelpCommand",
       "?" => "Psy\Command\HelpCommand",
       "ls" => "Psy\Command\ListCommand",
       "list" => "Psy\Command\ListCommand",
       "dir" => "Psy\Command\ListCommand",
       "dump" => "Psy\Command\DumpCommand",
       "doc" => "Psy\Command\DocCommand",
       "rtfm" => "Psy\Command\DocCommand",
       "man" => "Psy\Command\DocCommand",
       "show" => "Psy\Command\ShowCommand",
       "wtf" => "Psy\Command\WtfCommand",
       "last-exception" => "Psy\Command\WtfCommand",
       "wtf?" => "Psy\Command\WtfCommand",
       "whereami" => "Psy\Command\WhereamiCommand",
       "throw-up" => "Psy\Command\ThrowUpCommand",
       "timeit" => "Psy\Command\TimeitCommand",
       "trace" => "Psy\Command\TraceCommand",
       "buffer" => "Psy\Command\BufferCommand",
       "buf" => "Psy\Command\BufferCommand",
       "clear" => "Psy\Command\ClearCommand",
       "edit" => "Psy\Command\EditCommand",
       "sudo" => "Psy\Command\SudoCommand",
       "history" => "Psy\Command\HistoryCommand",
       "hist" => "Psy\Command\HistoryCommand",
       "exit" => "Psy\Command\ExitCommand",
       "quit" => "Psy\Command\ExitCommand",
       "q" => "Psy\Command\ExitCommand",
       "clear-compiled" => "Illuminate\Foundation\Console\ClearCompiledCommand",
       "down" => "Illuminate\Foundation\Console\DownCommand",
       "env" => "Illuminate\Foundation\Console\EnvironmentCommand",
       "optimize" => "Illuminate\Foundation\Console\OptimizeCommand",
       "up" => "Illuminate\Foundation\Console\UpCommand",
       "migrate" => "Illuminate\Database\Console\Migrations\MigrateCommand",
       "inspire" => "Illuminate\Foundation\Console\ClosureCommand",
     ],
     "updates" => [
       "update available" => false,
       "latest release version" => "v0.9.9",
       "update check interval" => "never",
       "update cache file" => "~/.config/psysh/update_check.json",
     ],
     "pcntl" => [
       "pcntl available" => true,
       "posix available" => true,
     ],
     "readline" => [
       "readline available" => true,
       "readline enabled" => true,
       "readline service" => "Psy\Readline\Libedit",
       "readline library" => "EditLine wrapper",
     ],
     "history" => [
       "history file" => "~/.config/psysh/psysh_history",
       "history size" => null,
       "erase duplicates" => null,
     ],
     "docs" => [
       "manual db file" => null,
       "sqlite available" => true,
     ],
     "autocomplete" => [
       "tab completion enabled" => true,
       "custom matchers" => [],
       "bracketed paste" => false,
     ],
   ]
>>>
@simensen
Copy link
Author

Actually, one thing that isn't clear to me: will this only tab complete namespaces and classes that exist, or namespaces and classes that have been autoloaded? If that is spelled out in the docs somewhere I missed it.

@bobthecow
Copy link
Owner

Yep. Because autoloading happens on demand, and PHP has no way of enumerating all the classes that could be autoloaded (without trying all files it finds) it only works with classes you've already autoloaded. See #539 (comment) for an idea about how we could improve this :)

@bobthecow
Copy link
Owner

(Closing as a duplicate of #539)

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