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

[Suggestion] Do not try to guess a root if lsp--suggest-project-root failed #3973

Merged
merged 3 commits into from
Apr 23, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion lsp-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,15 @@ following `projectile'/`project.el' conventions."
:group 'lsp-mode
:type 'boolean)

(defcustom lsp-guess-root-without-session nil
"Ignore the session file when calculating the project root.
You almost always want to set lsp-auto-guess-root too.
Do *not* use this setting unless you are familiar with `lsp-mode'
internals and you are sure that all of your projects are
following `projectile'/`project.el' conventions."
:group 'lsp-mode
:type 'boolean)

(defcustom lsp-restart 'interactive
"Defines how server-exited events must be handled."
:group 'lsp-mode
Expand Down Expand Up @@ -8894,7 +8903,8 @@ Select action: "
(or
(when lsp-auto-guess-root
(lsp--suggest-project-root))
(lsp-find-session-folder session file-name)
(unless lsp-guess-root-without-session
(lsp-find-session-folder session file-name))
(unless lsp-auto-guess-root
(when-let ((root-folder (lsp--find-root-interactively session)))
(if (or (not (f-equal? root-folder (expand-file-name "~/")))
Expand Down