TysonAndre / lsp-phan

WIP to run Phan in LSP for emacs.
GNU General Public License v3.0
3 stars 0 forks source link

Debugger entered--Lisp error: (void-function file-name) #4

Closed quan-na closed 5 years ago

quan-na commented 5 years ago

I got this error, look like file-name is not a function anymore, can I use another function instead?

Debugger entered--Lisp error: (void-function file-name) (file-name lsp-phan-server-install-dir) (concat (file-name lsp-phan-server-install-dir) "vendor/bin/phan") (closure (t) nil (concat (file-name lsp-phan-server-install-dir) "vendor/bin/phan"))() funcall((closure (t) nil (concat (file-name lsp-phan-server-install-dir) "vendor/bin/phan"))) eval((funcall (function (closure (t) nil (concat (file-name lsp-phan-server-install-dir) "vendor/bin/phan"))))) custom-initialize-reset(lsp-phan-phan-script-path (funcall (function (closure (t) nil (concat (file-name lsp-phan-server-install-dir) "vendor/bin/phan"))))) custom-declare-variable(lsp-phan-phan-script-path (funcall (function (closure (t) nil (concat (file-name lsp-phan-server-install-dir) "vendor/bin/phan")))) "Optional (Advanced).\nIf provided, this overrides the Phan script or phar file to use.\ne.g. \"/path/to/phan_git_checkout/phan\"" :group lsp-phan :risky t :type file) eval-buffer(#<buffer load-166530> nil "/home/2rua/.emacs.d/cabages/lsp-phan/lsp-phan.el" nil t) ; Reading at buffer position 3096 load-with-code-conversion("/home/2rua/.emacs.d/cabages/lsp-phan/lsp-phan.el" "/home/2rua/.emacs.d/cabages/lsp-phan/lsp-phan.el" nil t) require(lsp-phan)

TysonAndre commented 5 years ago

That should have been expand-file-name. I fixed that just now in the latest master branch.

See https://github.com/TysonAndre/lsp-phan#emacs instead for a known working way to set this up directly - I haven't had the time to finish up the helper configuration methods

(defvar lsp-phan-language-server-command
  (list
    "php"
    "/path/to/phan_stable/phan"
    "--language-server-allow-missing-pcntl"
    "--allow-polyfill-parser"
    "--use-fallback-parser"
    "--memory-limit" "1G"
    "--language-server-enable-go-to-definition"
    "--project-root-directory" "/path/to/analyzed_project"
    "--language-server-on-stdin"))
quan-na commented 5 years ago

Thank you :smile: I had it work using these config:

(custom-set-variables '(lsp-phan-memory-limit "2G") '(lsp-response-timeout 30)) (add-hook 'php-mode-hook (lambda () (setq phan-default-directory (projectile-project-root)) (lsp-phan-enable)))

other defaults worked fine when putting phan directory in .emacs.d