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

racer-complete fails with "wrong-type-argument stringp nil" #87

Open
jo-so opened this issue Jul 9, 2017 · 0 comments
Open

racer-complete fails with "wrong-type-argument stringp nil" #87

jo-so opened this issue Jul 9, 2017 · 0 comments

Comments

@jo-so
Copy link

jo-so commented Jul 9, 2017

The backtrace:

Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  string-to-number(nil)
  (put-text-property 0 1 (quote line) (string-to-number line) name)
  (let* ((--dash-source-6-- (s-split-up-to "," (s-chop-prefix "MATCH " it) 5)) (name (car-safe (prog1 --dash-source-6-- (setq --dash-source-6-- (cdr --dash-source-6--))))) (line (car-safe (prog1 --dash-source-6-- (setq --dash-source-6-- (cdr --dash-source-6--))))) (col (car-safe (prog1 --dash-source-6-- (setq --dash-source-6-- (cdr --dash-source-6--))))) (file (car-safe (prog1 --dash-source-6-- (setq --dash-source-6-- (cdr --dash-source-6--))))) (matchtype (car-safe (prog1 --dash-source-6-- (setq --dash-source-6-- (cdr --dash-source-6--))))) (ctx (car --dash-source-6--))) (put-text-property 0 1 (quote line) (string-to-number line) name) (put-text-property 0 1 (quote col) (string-to-number col) name) (put-text-property 0 1 (quote file) file name) (put-text-property 0 1 (quote matchtype) matchtype name) (put-text-property 0 1 (quote ctx) ctx name) name)
  (closure ((_ignore . "place_holder_re") t) (it) (let* ((--dash-source-6-- (s-split-up-to "," (s-chop-prefix "MATCH " it) 5)) (name (car-safe (prog1 --dash-source-6-- (setq --dash-source-6-- (cdr --dash-source-6--))))) (line (car-safe (prog1 --dash-source-6-- (setq --dash-source-6-- (cdr --dash-source-6--))))) (col (car-safe (prog1 --dash-source-6-- (setq --dash-source-6-- (cdr --dash-source-6--))))) (file (car-safe (prog1 --dash-source-6-- (setq --dash-source-6-- (cdr --dash-source-6--))))) (matchtype (car-safe (prog1 --dash-source-6-- (setq --dash-source-6-- (cdr --dash-source-6--))))) (ctx (car --dash-source-6--))) (put-text-property 0 1 (quote line) (string-to-number line) name) (put-text-property 0 1 (quote col) (string-to-number col) name) (put-text-property 0 1 (quote file) file name) (put-text-property 0 1 (quote matchtype) matchtype name) (put-text-property 0 1 (quote ctx) ctx name) name))("MATCH place_holder_re")
  mapcar((closure ((_ignore . "place_holder_re") t) (it) (let* ((--dash-source-6-- (s-split-up-to "," (s-chop-prefix "MATCH " it) 5)) (name (car-safe (prog1 --dash-source-6-- (setq --dash-source-6-- (cdr --dash-source-6--))))) (line (car-safe (prog1 --dash-source-6-- (setq --dash-source-6-- (cdr --dash-source-6--))))) (col (car-safe (prog1 --dash-source-6-- (setq --dash-source-6-- (cdr --dash-source-6--))))) (file (car-safe (prog1 --dash-source-6-- (setq --dash-source-6-- (cdr --dash-source-6--))))) (matchtype (car-safe (prog1 --dash-source-6-- (setq --dash-source-6-- (cdr --dash-source-6--))))) (ctx (car --dash-source-6--))) (put-text-property 0 1 (quote line) (string-to-number line) name) (put-text-property 0 1 (quote col) (string-to-number col) name) (put-text-property 0 1 (quote file) file name) (put-text-property 0 1 (quote matchtype) matchtype name) (put-text-property 0 1 (quote ctx) ctx name) name)) ("MATCH place_holder_re"))
  racer-complete("place_holder_re")

The return of (racer--call-at-point "complete") contains the element »"MATCH place_holder_"«.

% racer --version
racer 2.0.8
% rustc --version
rustc 1.20.0-nightly (696412de7 2017-07-06)
% cargo --version
cargo 0.21.0-nightly (eb6cf012a 2017-07-02)

My fix:

--- /tmp/racel.el.orig  2017-07-09 17:54:53.197355812 +0200
+++ /home/joerg/.emacs.d/elpa/racer-20170218.516/racer.el       2017-07-09 17:53:16.923083791 +0200
@@ -612,7 +612,7 @@
 (defun racer-complete (&optional _ignore)
   "Completion candidates at point."
   (->> (racer--call-at-point "complete")
-       (--filter (s-starts-with? "MATCH" it))
+       (--filter (s-match "^MATCH .*," it))
        (--map (-let [(name line col file matchtype ctx)
                      (s-split-up-to "," (s-chop-prefix "MATCH " it) 5)]
                 (put-text-property 0 1 'line (string-to-number line) name)
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

1 participant