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

Fix lsp--suggest-project-root always suggesting something #3972

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Commits on Feb 25, 2023

  1. 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
        ```
    ia0 committed Feb 25, 2023
    Configuration menu
    Copy the full SHA
    f63f009 View commit details
    Browse the repository at this point in the history

Commits on Apr 22, 2023

  1. Configuration menu
    Copy the full SHA
    9704664 View commit details
    Browse the repository at this point in the history