   (let ((fname (get-text-property 0 'fname arg))
         (linenum (get-text-property 0 'linenum arg)))
     (cons fname (string-to-number linenum))))
-
-(defun racer--complete-at-point-fn ()
-  "Run the racer complete command and process the results."
-  (let ((racer-tmp-file-name (make-temp-file "racer"))
-        (racer-completion-results '()))
-    (racer--write-tmp-file racer-tmp-file-name)
-    (setenv "RUST_SRC_PATH" (expand-file-name racer-rust-src-path))
-    (save-excursion
-      (let ((lines (process-lines racer-cmd
-                                  "complete"
-                                  (number-to-string (racer-get-line-number))
-                                  (number-to-string (current-column))
-				  (buffer-file-name)
-                                  racer-tmp-file-name))
-            racer-start-pos
-            racer-end-pos)
-        (delete-file racer-tmp-file-name)
-        (dolist (line lines)
-          (when (string-match "^MATCH \\([^,]+\\),\\(.+\\)$" line)
-            (let ((completion (match-string 1 line)))
-              (push completion racer-completion-results)))
-
-          (when (string-match "^PREFIX \\(.+\\),\\(.+\\),\\(.*\\)$" line)
-            (setq racer-start-pos (string-to-number (match-string 1 line)))
-            (setq racer-end-pos (string-to-number (match-string 2 line)))))
-        (list (- (point) (- racer-end-pos racer-start-pos))
-              (point)
-              racer-completion-results)))))
 
 (defun racer--company-annotation (arg)
   "Gets and formats annotation data from the arg match."

            (push completion racer-completion-results))))
      racer-completion-results)))

(defun racer--prefix ()
  "Run the racer prefix command and process the results."
  (let ((racer-tmp-file-name (make-temp-file "racer")))
    (racer--write-tmp-file racer-tmp-file-name)
    (setenv "RUST_SRC_PATH" (expand-file-name racer-rust-src-path))
    (let ((lines (process-lines racer-cmd
                                "prefix"
                                (number-to-string (racer-get-line-number))
                                (number-to-string (current-column))
                                racer-tmp-file-name)))
      (delete-file racer-tmp-file-name)
      (when (string-match "^PREFIX \\(.+\\),\\(.+\\),\\(.*\\)$" (nth 0 lines))
        (match-string 3 (nth 0 lines))))))

(defun racer--company-prefix ()
    "Returns the symbol to complete. If racer-begin-after-member-access is t,
begins completion automatically if the cursor is followed by a dot or ::."

  (set (make-local-variable 'company-backends) '(racer-company-complete)))

(defun racer--syntax-highlight (str)
  "Apply font-lock properties to a string STR of Rust code."
  (with-temp-buffer
    (insert str)
    (delay-mode-hooks (rust-mode))
    (font-lock-fontify-buffer)
    (buffer-string)))

(defun racer--goto-func-name ()
  "If point is inside a function call, move to the function name.
