Pathy is a Zed extension (Rust -> WASM) that launches a sidecar LSP server to provide filesystem path completions inside string literals. It runs as a secondary language server and only advertises completion capability.
It completes relative (./, ../), absolute (/), and home (~/) paths, in
any language listed in extension.toml, and merges with the completions of the
language's primary server.
By default it behaves like nvim-cmp's cmp-path: any path-like token
(src/ma, ./fo, ~/Do, /etc/ho, ..) is completed regardless of the
surrounding context or language — including plain-text files. Inside string
literals it additionally understands quoting and Python call-site contexts.
- Build the extension (Zed builds WASM automatically) or open the repo in Zed.
- In Zed, open the command palette and select "Extensions: Install Dev Extension".
- Choose this repo root (the directory containing
extension.toml). - Grant required capabilities if prompted (see below).
The extension needs:
process:execto launch the sidecar serverdownload_fileto fetch release binaries
These are already declared in extension.toml. If Zed prompts for approval,
accept them.
Settings live under lsp.pathy.settings in your Zed settings. This single block
contains both extension-level settings (download behavior) and server settings
(completion behavior).
Enable Pathy per language, keeping the primary language server first:
{
"languages": {
"Python": { "language_servers": ["pyright", "pathy", "..."] },
"Rust": { "language_servers": ["rust-analyzer", "pathy", "..."] }
}
}For languages without an explicit language_servers list, Pathy is started
automatically once the language is listed in extension.toml.
{
"lsp": {
"pathy": {
"settings": {
"auto_download": true,
"server_path": null,
"release_channel": "stable",
"base_url": null,
"verify_checksum": true,
"cache_dir": null
}
}
}
}Notes:
server_pathtakes precedence. If set and exists, no download is attempted.auto_downloadmust betrueto fetch release assets.release_channelonly supportsstable.base_urlis advanced; default points athttps://github.com/Avimitin/pathy.cache_dirmust be a relative path (relative to the extension working dir).
Defaults shown in parentheses:
enable(true)mode("anywhere"): "anywhere" | "string"path_prefix_fallback(true)context_gating("smart"): "off" | "smart" | "strict"base_dir("file_dir"): "file_dir" | "workspace_root" | "both"workspace_root_strategy("lsp_root_uri"): "lsp_root_uri" | "disabled"max_results(80)show_hidden(false)include_files(true)include_directories(true)directory_trailing_slash(true)ignore_globs(["/.git/", "/.venv/", "/venv/", "/pycache/", "/.pytest_cache/", "/.mypy_cache/", "/.ruff_cache/", "/node_modules/", "/target/", "/dist/", "/build/", "/.direnv/"])prefer_forward_slashes(true)expand_tilde(true)windows_enable_drive_prefix(true)windows_enable_unc(true)cache_ttl_ms(500)cache_max_dirs(64)stat_strategy("lazy"): "none" | "lazy" | "eager"
mode semantics:
"anywhere"(default): complete bare path tokens anywhere in the document, outside string literals too (cmp-pathbehavior). This covers plain-text files, code, comments, and everything in between."string": only complete inside string literals.
context_gating applies to string-literal completion:
"off": complete anywhere."smart": complete on an explicit path prefix, or in Python call-site contexts (open(...),Path(...),read_csv(...),path=arguments, ...)."strict": only complete in Python call-site contexts.
Example override:
{
"lsp": {
"pathy": {
"settings": {
"max_results": 40,
"show_hidden": true,
"mode": "anywhere"
}
}
}
}To use a local build of the server:
cd server
cargo build --releaseThen set server_path to the built binary:
- macOS/Linux:
server/target/release/pathy-server - Windows:
server/target/release/pathy-server.exe
Assets are raw binaries (no archives):
pathy-server_<VERSION>_macos_x86_64pathy-server_<VERSION>_macos_aarch64pathy-server_<VERSION>_linux_x86_64pathy-server_<VERSION>_windows_x86_64.exechecksums-<VERSION>.txt
MIT. See LICENSE.