troubleshooting.md

 1# Troubleshooting
 2
 3This guide covers common troubleshooting techniques for Zed.
 4Sometimes you'll be able to identify and resolve issues on your own using this information.
 5Other times, troubleshooting means gathering the right information—logs, profiles, or reproduction steps—to help us diagnose and fix the problem.
 6
 7## Zed Log
 8
 9Often, a good first place to look when troubleshooting any issue in Zed is the Zed log, which might contain clues about what's going wrong.
10You can review the most recent 1000 lines of the log by running the {#action zed::OpenLog} command from the command palette (`cmd-shift-p` on macOS or `ctrl-shift-p` on Windows/Linux).
11If you want to view the full file, you can reveal it in your operating system's native file manager via {#action zed::RevealLogInFileManager}.
12
13You'll find the Zed log in the respective location on each operating system:
14
15- macOS: `~/Library/Logs/Zed/Zed.log`
16- Windows: `C:\Users\YOU\AppData\Local\Zed\logs\Zed.log`
17- Linux: `~/.local/share/zed/logs/Zed.log` or `$XDG_DATA_HOME`
18
19> Note: In some cases, it might be useful to monitor the log live, such as when [developing a Zed extension](https://zed.dev/docs/extensions/developing-extensions).
20> Example: `tail -f ~/Library/Logs/Zed/Zed.log`
21
22The log may contain enough context to help you debug the issue yourself, or you may find specific errors that are useful when filing a [GitHub issue](https://github.com/zed-industries/zed/issues/new/choose) or when talking to Zed staff in our [Discord server](https://zed.dev/community-links#forums-and-discussions).
23
24## Performance Issues (Profiling)
25
26If you're running into performance issues in Zed—such as hitches, hangs, or general unresponsiveness—having a performance profile attached to your issue will help us zero in on what is getting stuck, so we can fix it.
27
28### macOS
29
30Xcode Instruments (which comes bundled with your [Xcode](https://apps.apple.com/us/app/xcode/id497799835) download) is the standard tool for profiling on macOS.
31
321. With Zed running, open Instruments
331. Select `Time Profiler` as the profiling template
341. In the `Time Profiler` configuration, set the target to the running Zed process
351. Start recording
361. If the performance issue occurs when performing a specific action in Zed, perform that action now
371. Stop recording
381. Save the trace file
391. Compress the trace file into a zip archive
401. File a [GitHub issue](https://github.com/zed-industries/zed/issues/new/choose) with the trace zip attached
41
42<!--### Windows-->
43
44<!--### Linux-->
45
46## Startup and Workspace Issues
47
48Zed creates local SQLite databases to persist data relating to its workspace and your projects. These databases store, for instance, the tabs and panes you have open in a project, the scroll position of each open file, the list of all projects you've opened (for the recent projects modal picker), etc. You can find and explore these databases in the following locations:
49
50- macOS: `~/Library/Application Support/Zed`
51- Linux and FreeBSD: `~/.local/share/zed` (or within `XDG_DATA_HOME` or `FLATPAK_XDG_DATA_HOME`)
52- Windows: `%LOCALAPPDATA%\Zed`
53
54The naming convention of these databases takes on the form of `0-<zed_channel>`:
55
56- Stable: `0-stable`
57- Preview: `0-preview`
58
59While rare, we've seen a few cases where workspace databases became corrupted, which prevented Zed from starting.
60If you're experiencing startup issues, you can test whether it's workspace-related by temporarily moving the database from its location, then trying to start Zed again.
61
62> **Note**: Moving the workspace database will cause Zed to create a fresh one.
63> You will lose your recent projects, open tabs, and cursor locations in active files.
64
65If your issue persists after regenerating the database, please [file an issue](https://github.com/zed-industries/zed/issues/new/choose).
66
67## Language Server Issues
68
69If you're experiencing language-server related issues, such as stale diagnostics or issues jumping to definitions, restarting the language server via {#action editor::RestartLanguageServer} can be a quick fix.