Skip to content

Commit 330fe97

Browse files
veraciouxjcs090218
andauthored
fix: Ignore persist when lsp-session-file is nil (#4888)
Co-authored-by: Jen-Chieh Shen <[email protected]>
1 parent 96beaff commit 330fe97

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

CHANGELOG.org

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
* Added Odin langauge server support [[https://github.com/DanielGavin/ols][ols]]
4646
* Fix bug in lsp-odin where ~f-join~ collapses double slashes. Using ~format~ instead.
4747
* Fix missing gopls inlay hints when ~lsp-use-plist~ is true
48+
* Fix bug where persist was attempted when lsp-session-file is nil
4849

4950
** 9.0.0
5051
* Add language server config for QML (Qt Modeling Language) using qmlls.

lsp-mode.el

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9380,10 +9380,13 @@ The library folders are defined by each client for each of the active workspace.
93809380

93819381
(defun lsp--persist-session (session)
93829382
"Persist SESSION to `lsp-session-file'."
9383-
(lsp--persist lsp-session-file (make-lsp-session
9384-
:folders (lsp-session-folders session)
9385-
:folders-blocklist (lsp-session-folders-blocklist session)
9386-
:server-id->folders (lsp-session-server-id->folders session))))
9383+
(if lsp-session-file
9384+
(lsp--persist lsp-session-file (make-lsp-session
9385+
:folders (lsp-session-folders session)
9386+
:folders-blocklist (lsp-session-folders-blocklist session)
9387+
:server-id->folders
9388+
(lsp-session-server-id->folders session)))
9389+
(message "lsp-session-file is nil, not persisting session.")))
93879390

93889391
(defun lsp--try-project-root-workspaces (ask-for-client ignore-multi-folder)
93899392
"Try create opening file as a project file.

0 commit comments

Comments
 (0)