Fixing Zed's language server
Published: ....
Last modified: ....
Share this post on BlueskySee discussion on Bluesky
I was recently trying out the Zed editor instead of VSCode, however for a while I was struggling with getting the language server to work for a project. I wasn't seeing any inlay hints, nor any hover tooltips for any JavaScript or TypeScript code, it was getting pretty frustrating.
I was about to give up on it and go back to VSCode, but I figured I'd give it one last go.
After some debugging, I found out a few things that felt decently buried in their support forums so I figured I'd blog them here in case others run into the same issue and are looking for the solution.
TL;DR
If you aren't getting any type hints / hover tooltips etc for JavaScript or
TypeScript and you're not sure why, check for package.json
or node_modules
in your root directory (~/
). If those files/folders exist, delete them and
close and re-open Zed!
Apparently Zed installs language servers (or at least the
typescript-language-server
) from npm, however it usually does this within some
subdirectory where it caches a few other things, something like
~/Library/Application Support/Zed/
.
However, that logic that Zed uses to install the language server maybe shortcuts
/ runs into an issue if you have a top level package.json
within your root
directory, e.g. ~/
. In that case, it installs the language server at the root
instead of within the application's folder.
This will wreck some havoc when Zed tries to launch the language server when it
starts up. Another pro tip is that you can check the logs from Zed in the
following log file: ~/Library/Logs/Zed/Zed.log
.
I found this solution from this GitHub comment!
Tags:
Related Posts
Tip
Published: ....
A quick tip to implementing CSS theming that's compatible with Server Side Rendered applications!
Published: ....
Recently Dropbox announced that it was shutting down the Capture app/service, so I sought out an alternative that provided a similar user experience!
Published: ....
A quick tip outlining how to provide specific TypeScript type definitions for a local module!
Published: ....
A (running) collection of Bluesky tips, tools, packages, and other misc things!
Published: ....
A quick look at a small but powerful pattern I've been leveraging as of late!
Published: ....
React components have a fundamental contract that is often unstated in their implementation, and you should know about it!
Published: ....
Replace that old useState and useEffect combo for a new and better option!
Published: ....
There's a common gotcha when creating Web Request and Response instances with Headers!
Published: ....
How to easily mass-export your custom slack emoji without API access!