← Back to all posts

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

Async Class Creation In JavaScript

Published: ....

Have you ever wanted to create a class in JavaScript or TypeScript but also have the initialization be async? Here's a quick tip on a pattern that I've used in the past!

Server Side Rendering Compatible CSS Theming

Published: ....

A quick tip to implementing CSS theming that's compatible with Server Side Rendered applications!

Replacing Dropbox Capture with Raycast

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!

Quick Tip - Specific Local Module Declarations

Published: ....

A quick tip outlining how to provide specific TypeScript type definitions for a local module!

Bluesky Tips and Tools

Published: ....

A (running) collection of Bluesky tips, tools, packages, and other misc things!

The Bookkeeping Pattern

Published: ....

A quick look at a small but powerful pattern I've been leveraging as of late!

Don't Break the Implicit Prop Contract

Published: ....

React components have a fundamental contract that is often unstated in their implementation, and you should know about it!

A Better useSSR Implementation

Published: ....

Replace that old useState and useEffect combo for a new and better option!

Tip: Request and Response Headers

Published: ....

There's a common gotcha when creating Web Request and Response instances with Headers!

Exporting Custom Slack Emoji

Published: ....

How to easily mass-export your custom slack emoji without API access!