Replies: 1 comment 3 replies
-
This will prevent some issues, but it will cause tons of other issues related to multiroot projects, and also not persisting the project roots will cause usability issue if we ask about project roots on each restart. I have plans to add a warning if you add home folder as a project root. I believe doom has that in their implementation of this feature.
I have plans to implement that as opt-in option in order to support root-less mode. |
Beta Was this translation helpful? Give feedback.
-
I thought I'd point out one drawback of the "auto-collect into sessions" approach lsp-mode takes. As a new user of lsp-mode, after a few hours of use, I found it caused emacs to grind to a halt. I've since discovered what was really happening: I'd opened a python file in my home directory. My lang server
pyright
happily tried to scan my entire (large) home directory, and it began choking. I killed Emacs and restarted. That should fix it! But lsp-mode had quietly saved my home directory as part of a session in the file~/.emacs.d/.lsp-session-v1
. So even after killing emacs and pyright, my install was effectively "broken" from there on, since (as I didn't know at the time) lsp-mode consults this file and starts any new server looking through everything referenced in it (i.e. all files in my home-dir). I uninstalled lsp-mode and moved on.Now arguably this was a dumb move, but I bet it happens a lot. I suppose the option I was supposed to have picked was blacklist or do nothing, but neither of those made sense at the time, and when I tried them, no server got run. I think a default configuration of "we'll start a lang server for this project for you but won't remember it" might be simpler for new users, and prevent these kinds of issues. I.e. opt-in to the idea of persistent sessions, so a "polluted" session list doesn't give non-obvious issues.
A perhaps similar idea is a catchall "if I open a file anywhere random that would require importing into the session, consider it part of the following default project" to prevent over-eager language servers from scanning everything in sight.
Beta Was this translation helpful? Give feedback.
All reactions