`ediff-current-file`, locate-dominating-file: Wrong type argument: stringp, nil
- Dominant language
- Emacs Lisp
- Stars
- 0
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
With `(setq dart-enable-analysis-server t)`, if we try to compare contents of modified buffer to file, with `M-x ediff-current-buffer`, we get a message, `Wrong type argument: stringp, nil`, and if we toggle `debug-on-error`, we get the following backtrace.
```
Debugger entered--Lisp error: (wrong-type-argument stringp nil)
expand-file-name(nil)
locate-dominating-file(nil "pubspec.yaml")
(let* ((file-to-add (or file buffer-file-name)) (pub-root (locate-dominating-file file-to-add "pubspec.yaml")) (current-dir (file-name-directory file-to-add))) (if pub-root (dart-add-to-analysis-roots (directory-file-name (expand-file-name pub-root))) (dart-add-to-analysis-roots (directory-file-name (expand-file-name current-dir)))))
dart-add-analysis-root-for-file()
dart--start-analysis-server-for-current-buffer()
(if (null dart-sdk-path) (dart-log "Cannot find `dart' executable or Dart analysis server snapshot.") (dart--start-analysis-server-for-current-buffer))
(progn (if (null dart-sdk-path) (dart-log "Cannot find `dart' executable or Dart analysis server snapshot.") (dart--start-analysis-server-for-current-buffer)))
(if dart-enable-analysis-server (progn (if (null dart-sdk-path) (dart-log "Cannot find `dart' executable or Dart analysis server snapshot.") (dart--start-analysis-server-for-current-buffer))))
(let ((delay-mode-hooks t)) (prog-mode) (setq major-mode 'dart-mode) (setq mode-name "Dart") (progn (if (get 'prog-mode 'mode-class) (put 'dart-mode 'mode-class (get 'prog-mode 'mode-class))) (if (keymap-parent dart-mode-map) nil (set-keymap-parent dart-mode-map (current-local-map))) (let ((parent (char-table-parent dart-mode-syntax-table))) (if (and parent (not (eq parent (standard-syntax-table)))) nil (set-char-table-parent dart-mode-syntax-table (syntax-table)))) (if (or (abbrev-table-get dart-mode-abbrev-table :parents) (eq dart-mode-abbrev-table local-abbrev-table)) nil (abbrev-table-put dart-mode-abbrev-table :parents (list local-abbrev-table)))) (use-local-map dart-mode-map) (set-syntax-table dart-mode-syntax-table) (setq local-abbrev-table dart-mode-abbrev-table) (modify-syntax-entry 47 "_ 124b") (modify-syntax-entry 42 ". 23") (modify-syntax-entry 10 "> b") (modify-syntax-entry 39 "\"") (set (make-local-variable 'electric-indent-chars) '(10 41 93 125)) (setq comment-start "//") (setq comment-end "") (setq fill-column 80) (setq font-lock-defaults dart-font-lock-defaults) (setq indent-line-function 'dart-indent-line-function) (setq indent-tabs-mode nil) (setq tab-width 2) (set (make-local-variable 'syntax-propertize-function) dart-syntax-propertize-function) (if dart-enable-analysis-server (progn (if (null dart-sdk-path) (dart-log "Cannot find `dart' executable or Dart analysis server snapshot.") (dart--start-analysis-server-for-current-buffer)))) (add-hook (make-local-variable 'before-save-hook) #'(lambda nil (if dart-format-on-save (progn (dart-format))))))
(progn (make-local-variable 'delay-mode-hooks) (let ((delay-mode-hooks t)) (prog-mode) (setq major-mode 'dart-mode) (setq mode-name "Dart") (progn (if (get 'prog-mode 'mode-class) (put 'dart-mode 'mode-class (get 'prog-mode 'mode-class))) (if (keymap-parent dart-mode-map) nil (set-keymap-parent dart-mode-map (current-local-map))) (let ((parent (char-table-parent dart-mode-syntax-table))) (if (and parent (not (eq parent ...))) nil (set-char-table-parent dart-mode-syntax-table (syntax-table)))) (if (or (abbrev-table-get dart-mode-abbrev-table :parents) (eq dart-mode-abbrev-table local-abbrev-table)) nil (abbrev-table-put dart-mode-abbrev-table :parents (list local-abbrev-table)))) (use-local-map dart-mode-map) (set-syntax-table dart-mode-syntax-table) (setq local-abbrev-table dart-mode-abbrev-table) (modify-syntax-entry 47 "_ 124b") (modify-syntax-entry 42 ". 23") (modify-syntax-entry 10 "> b") (modify-syntax-entry 39 "\"") (set (make-local-variable 'electric-indent-chars) '(10 41 93 125)) (setq comment-start "//") (setq comment-end "") (setq fill-column 80) (setq font-lock-defaults dart-font-lock-defaults) (setq indent-line-function 'dart-indent-line-function) (setq indent-tabs-mode nil) (setq tab-width 2) (set (make-local-variable 'syntax-propertize-function) dart-syntax-propertize-function) (if dart-enable-analysis-server (progn (if (null dart-sdk-path) (dart-log "Cannot find `dart' executable or Dart analysis server snapshot.") (dart--start-analysis-server-for-current-buffer)))) (add-hook (make-local-variable 'before-save-hook) #'(lambda nil (if dart-format-on-save (progn (dart-format)))))))
dart-mode()
ediff-current-file()
funcall-interactively(ediff-current-file)
call-interactively(ediff-current-file record nil)
command-execute(ediff-current-file record)
execute-extended-command(nil "ediff-current-file" "ediff-cur")
funcall-interactively(execute-extended-command nil "ediff-current-file" "ediff-cur")
call-interactively(execute-extended-command nil nil)
command-execute(execute-extended-command)
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start at dart-add-analysis-root-for-file and trace its call from dart--start-analysis-server-for-current-buffer during ediff-current-file. Reproduce with dart-enable-analysis-server set to t; done means M-x ediff-current-buffer no longer raises the reported stringp nil error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- emacs, emacs-lisp
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100