zed
zed copied to clipboard
Language servers don't work until new file is reopened
Summary
Steps to trigger the problem:
- Set up language servers for your language of choice
- Create a new file, type some code, and save it
- Do anything that triggers the language server (e.g. format on save, hover over a variable, type some bad code)
- Close and reopen
Actual Behavior: Zed behaves as if there is no language server configured until the file is reopened
Expected Behavior: The language server should work normally
There is no relevant output in Zed's logs or the LSP logs.
Zed Version and System Specs
Zed: v0.172.8 (Zed) OS: macOS 15.3.0 Memory: 16 GiB Architecture: x86_64
I can reproduce. My steps:
mkdir /tmp/issue24249
cd $_
echo 'print("bar")' > bar.lua
zed . bar.lua
Click yes to install lua extension and lua-language-server.
Hover over print to confirm LSP is working
Close bar.lua.
Quit zed
Click in the edit pane and press cmd-n to create a new file
type print("foo") into the buffer
cmd-s and save as foo.lua
No lua-language-server (hover, etc) Close buffer (cmd-w) and reopen buffer (cmd-shift-t) Watch LSP load. Hover works.