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

xref-find-definitions error #13

Open
VasilVasilev93 opened this issue Apr 2, 2018 · 11 comments
Open

xref-find-definitions error #13

VasilVasilev93 opened this issue Apr 2, 2018 · 11 comments

Comments

@VasilVasilev93
Copy link

I'm using Emacs 25.1.1 and js2-mode along with xref-js2. I've set up like described in readme:

(require 'xref-js2)

(define-key js2-mode-map (kbd "M-.") nil)
(add-hook 'js2-mode-hook (lambda ()
  (add-hook 'xref-backend-functions #'xref-js2-xref-backend nil t)))

This is the error after using M-.
Debugger entered--Lisp error: (wrong-type-argument stringp nil)
call-process(nil nil t nil "--js" "--noheading" "--nocolor" "--ignore-dir" "bower_components" "--ignore-dir" "node_modules" "--ignore-dir" "build" "--ignore-dir" "lib" "--ignore" ".min.js" "\bsetupCustomBindings\b[\s][:=][^=]|function[\s]+\bsetupCustomBindings$
apply(call-process nil nil t nil ("--js" "--noheading" "--nocolor" "--ignore-dir" "bower_components" "--ignore-dir" "node_modules" "--ignore-dir" "build" "--ignore-dir" "lib" "--ignore" ".min.js" "\bsetupCustomBindings\b[\s][:=][^=]|function[\s]+\bsetupCustomBi$
process-file(nil nil t nil "--js" "--noheading" "--nocolor" "--ignore-dir" "bower_components" "--ignore-dir" "node_modules" "--ignore-dir" "build" "--ignore-dir" "lib" "--ignore" ".min.js" "\bsetupCustomBindings\b[\s][:=][^=]|function[\s]+\bsetupCustomBindings$
apply(process-file nil nil t nil ("--js" "--noheading" "--nocolor" "--ignore-dir" "bower_components" "--ignore-dir" "node_modules" "--ignore-dir" "build" "--ignore-dir" "lib" "--ignore" ".min.js" "\bsetupCustomBindings\b[\s][:=][^=]|function[\s]+\bsetupCustomBi$
xref-js2--find-candidates("setupCustomBindings" "\bsetupCustomBindings\b[\s][:=][^=]|function[\s]+\bsetupCustomBindings\b|class[\s]+\bsetupCustomBindings\b|(?<!new)[^.]setupCustomBindings[\s]\(")
xref-js2--find-definitions("setupCustomBindings")
xref-js2--xref-find-definitions("setupCustomBindings")
#514 "\300^A!\207" [xref-js2--xref-find-definitions] 4 "\n\n(fn BACKEND SYMBOL)"
apply(#[514 "\300^A!\207" [xref-js2--xref-find-definitions] 4 "\n\n(fn BACKEND SYMBOL)"] xref-js2 "setupCustomBindings")
xref-backend-definitions(xref-js2 "setupCustomBindings")
xref--find-xrefs("setupCustomBindings" definitions "setupCustomBindings" nil)
xref--find-definitions("setupCustomBindings" nil)
xref-find-definitions("setupCustomBindings")
funcall-interactively(xref-find-definitions "setupCustomBindings")
call-interactively(xref-find-definitions nil nil)
command-execute(xref-find-definitions)

@ajpauwels
Copy link

ajpauwels commented May 8, 2018

I'm running into the same problem. Haven't had the time to trace the source yet, any luck? On Emacs 25.3.1, maybe an incompatibility with the dev version?

SOLVED: Don't be an idiot like me and not read the dependencies. Just install the silver searcher in your package manager and you should be good to go.

@VasilVasilev93
Copy link
Author

@ajpauwels thank you for your time, but I have the silver searcher installed along with the other dependencies, and it's not the case

@NicolasPetton
Copy link
Collaborator

What does (executable-find "ag") give you?

@gdanov
Copy link

gdanov commented Oct 3, 2018

I had the same problem and solved it by installing ag ...

@jjrh
Copy link

jjrh commented Nov 15, 2018

Same issue however I do have ag installed.

(wrong-number-of-arguments (lambda (k l) (nthcdr 1 (assoc k l))) 5)

(executable-find "ag")
"/usr/bin/ag"
$ which ag
/usr/bin/ag

$ ag --version                      
ag version 2.1.0

Features:
  +jit +lzma +zlib

@fjsousa
Copy link

fjsousa commented Nov 16, 2018

Same issue here.

This is my config:

(define-key js-mode-map (kbd "M-.") nil)

(add-hook 'js2-mode-hook (lambda ()
  (add-hook 'xref-backend-functions #'xref-js2-xref-backend nil t)))

which come from @NicolasPetton blog post and I've got ag installed

ELISP> (executable-find "ag")
"/usr/local/bin/ag"
ELISP> 

Also I'm on Emacs 26.1

@NicolasPetton
Copy link
Collaborator

Is it the same stacktrace as the original report? The original report showed that "ag" wasn't found.

@fjsousa
Copy link

fjsousa commented Nov 19, 2018

No, actually I don't get an error, the issue is with the same function but it just returns saying that no references where found.

@NicolasPetton
Copy link
Collaborator

NicolasPetton commented Nov 19, 2018 via email

@fjsousa
Copy link

fjsousa commented Dec 3, 2018

@NicolasPetton actually found my issue. I was working under lib, which was was being ignored by xref-js2. https://github.com/NicolasPetton/xref-js2/blob/master/xref-js2.el#L56

@NicolasPetton
Copy link
Collaborator

NicolasPetton commented Dec 6, 2018 via email

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

6 participants