syl20bnr / spacemacs

A community-driven Emacs distribution - The best editor is neither Emacs nor Vim, it's Emacs *and* Vim!
http://spacemacs.org
GNU General Public License v3.0
23.69k stars 4.9k forks source link

ac-php not working properly #7699

Closed cjohansson closed 4 years ago

cjohansson commented 7 years ago

If I add this to my .spacemacs in the section (defun dotspacemacs/user-config ()

  (use-package company-php)
  (use-package ac-php
     :config
     (add-hook 'php-mode-hook
               '(lambda ()
                  (add-to-list 'company-backends 'company-ac-php-backend)
                  (setq ac-sources '(ac-source-php)))))

And this to my dotspacemacs-additional-packages

ac-php
company-php

And this to my dotspacemacs-configuration-layers

     (auto-completion :variables
                      auto-completion-enable-snippets-in-popup t
                      auto-completion-enable-help-tooltip t
                      auto-completion-enable-sort-by-usage t)
    php

And after creating a ac-php-conf.json file in project root and running ac-php-remake-tags.

Expected result I should get scope-based auto-completion, like namespaces, classes, methods and functions with function descriptions generated from PhpDoc.

Actual result Only name based auto-completion based on current file without function descriptions.

It works without Spacemacs but it doesn't work with Spacemacs.

TheBB commented 7 years ago

Can you confirm whether the company backend is actually in the company-backends list, and whether it works if you call the company backend directly?

cjohansson commented 7 years ago

Do you mean this?

describe-variable:company-backends

...
Value: ((company-dabbrev-code company-gtags company-etags company-keywords :with company-yasnippet)
 (company-files :with company-yasnippet)
 (company-dabbrev :with company-yasnippet))

Original value was 
(company-bbdb company-nxml company-css company-eclim company-semantic company-clang company-xcode company-cmake company-capf company-files
              (company-dabbrev-code company-gtags company-etags company-keywords)
              company-oddmuse company-dabbrev)

Local in buffer Application.php; global value is 
(company-ac-php-backend php-extras-company company-bbdb company-nxml company-css company-eclim company-semantic company-clang company-xcode company-cmake company-capf company-files
                        (company-dabbrev-code company-gtags company-etags company-keywords)
                        company-oddmuse company-dabbrev)

If I manually run company-ac-php-backend I get the error Cannot complete at point

dbrw commented 6 years ago

Any update on this? It would be nice to have PHP layer with PHPdoc based auto completion.

github-actions[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please let us know if this issue is still valid!