xcwen / ac-php

emacs auto-complete & company-mode for php

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ac-php-tags not generating tags

ainnovari opened this issue · comments

I'm getting these erros on ac-php
ac-php: Something went wrong
ac-php: The re-indexing process exited abnormally
ac-php: Please re-check for incorrect sintax and possible PHP errors and try again later.

I'm running on emacs 29.1 with spacemacs and windows 11. The php version is 8.1.2 and everything runs normally.

commented

M-x ac-php-toggle-debug
and retest

I had the same problem. I ran M-x ac-php-toggle-debug, then M-x ac-php-remake-tags-all. The following is from the bottom of the Messages buffer.

[DEBUG]: 09% /home/werker/Temporary/Learn_Livewire/the-basics/vendor/laravel/framework/src/Illuminate/Database/Events/DatabaseRefreshed.php
[DEBUG]: PHP Fatal error: Uncaught Error: Call to undefined method PhpParser\Node\NullableType::toString() in phar:///home/werker/.emacs.d/elpa/29.1/develop/ac-php-core-20240105.604/phpctags/PHPCtags.class.php:519
[DEBUG]: Stack trace:
[DEBUG]: #0 phar:///home/werker/.emacs.d/elpa/29.1/develop/ac-php-core-20240105.604/phpctags/PHPCtags.class.php(284): PHPCtags->struct()
[DEBUG]: #1 phar:///home/werker/.emacs.d/elpa/29.1/develop/ac-php-core-20240105.604/phpctags/PHPCtags.class.php(445): PHPCtags->struct()
[DEBUG]: #2 phar:///home/werker/.emacs.d/elpa/29.1/develop/ac-php-core-20240105.604/phpctags/PHPCtags.class.php(284): PHPCtags->struct()
[DEBUG]: #3 phar:///home/werker/.emacs.d/elpa/29.1/develop/ac-php-core-20240105.604/phpctags/PHPCtags.class.php(605): PHPCtags->struct()
[DEBUG]: #4 phar:///home/werker/.emacs.d/elpa/29.1/develop/ac-php-core-20240105.604/phpctags/PHPCtags.class.php(284): PHPCtags->struct()
[DEBUG]: #5 phar:///home/werker/.emacs.d/elpa/29.1/develop/ac-php-core-20240105.604/phpctags/PHPCtags.class.php(697): PHPCtags->struct()
[DEBUG]: #6 phar:///home/werker/.emacs.d/elpa/29.1/develop/ac-php-core-20240105.604/phpctags/deal_config.php(270): PHPCtags->process_single_file()
[DEBUG]: #7 phar:///home/werker/.emacs.d/elpa/29.1/develop/ac-php-core-20240105.604/phpctags/deal_config.php(372): deal_file_tags()
[DEBUG]: #8 phar:///home/werker/.emacs.d/elpa/29.1/develop/ac-php-core-20240105.604/phpctags/bootstrap.php(260): deal_config()
[DEBUG]: #9 /home/werker/.emacs.d/elpa/29.1/develop/ac-php-core-20240105.604/phpctags(10): include('...')
[DEBUG]: #10 {main}
[DEBUG]: thrown in phar:///home/werker/.emacs.d/elpa/29.1/develop/ac-php-core-20240105.604/phpctags/PHPCtags.class.php on line 519
[DEBUG]:
ac-php: Something went wrong
ac-php: The re-indexing process exited abnormally
ac-php: Please re-check for incorrect syntax and possible PHP errors and try again later
[DEBUG]: exited abnormally with code 255

The important line appears to be:

[DEBUG]: PHP Fatal error: Uncaught Error: Call to undefined method PhpParser\Node\NullableType::toString() in phar:///home/werker/.emacs.d/elpa/29.1/develop/ac-php-core-20240105.604/phpctags/PHPCtags.class.php:519

The line is:

$field_return_type= $this->getRealClassName($param->type->toString(), $filed_scope);

$param->type has type ?Node, which has getType method instead of toString.