Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix lsp--suggest-project-root always suggesting something
This reverts emacs-lsp#2112. The intent of `lsp--suggest-project-root` is not to always return non-nil but instead return nil when no good suggestion is found and let the caller decide what to do in such case. This can be seen in 2 different ways: 1. All calls except in `lsp--calculate-root` (see 2 below) use the following form which demonstrates that the function should sometimes return nil. ``` (or (lsp--suggest-project-root) default-directory) ``` 2. We find the following snippet in `lsp--calculate-root` which demonstrates that the function should sometimes return nil (otherwise `unless lsp-auto-guess-root` could be removed since always true). ``` (or (when lsp-auto-guess-root (lsp--suggest-project-root)) (lsp-find-session-folder session file-name) (unless lsp-auto-guess-root ```
- Loading branch information