   (interactive)
   (tern-run-query (lambda (data _offset)
                     (let* ((file (cdr (assq 'file data)))
-                           (found (and file (setf file (concat (tern-project-dir) (cdr (assq 'file data))))
+                           (found (and file (setf file (expand-file-name (cdr (assq 'file data)) (tern-project-dir)))
                                        (tern-find-position file data))))
                       (if found
                           (progn

      (let ((project-dir (file-name-directory (buffer-file-name))))
        (loop for cur = project-dir then (file-name-directory (substring cur 0 (1- (length cur))))
              while cur do
              (when (file-exists-p (concat cur ".tern-project"))
                (return (setf project-dir cur))))
        (setf tern-project-dir project-dir))))


         (cond ((not err)
                (dolist (file files)
                  (when (equal (cdr (assq 'type file)) "full")
                    (with-current-buffer (find-file-noselect (expand-file-name (cdr (assq 'name file)) tern-project-dir))
                      (setf tern-buffer-is-dirty nil))))
                (funcall f data offset))
               ((not (eq mode :silent)) (message "Request failed: %s" (cdr err))))))
