Skip to content

Commit ceebcf6

Browse files
authored
Make zed:// links clickable in terminal (#3947)
1 parent 9f1e5a0 commit ceebcf6

5 files changed

Lines changed: 36 additions & 3 deletions

File tree

mkdocs/docs/concepts/dev-environments.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ To connect via SSH, use: `ssh vscode`
6565
6666
`dstack apply` automatically provisions an instance and sets up an IDE on it.
6767

68+
The `ide` property supports `vscode`, `cursor`, `windsurf`, and `zed`.
69+
6870
??? info "SSH-only"
6971
The `ide` property is optional. If omitted, no IDE is pre-installed, but the dev environment
7072
is still accessible via SSH:

src/dstack/_internal/core/models/configurations.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -685,9 +685,9 @@ def check_image_or_commands_present(cls, values):
685685

686686
class DevEnvironmentConfigurationParams(CoreModel):
687687
ide: Annotated[
688-
Optional[Union[Literal["vscode"], Literal["cursor"], Literal["windsurf"]]],
688+
Optional[Union[Literal["vscode"], Literal["cursor"], Literal["windsurf"], Literal["zed"]]],
689689
Field(
690-
description="The IDE to pre-install. Supported values include `vscode`, `cursor`, and `windsurf`. Defaults to no IDE (SSH only)"
690+
description="The IDE to pre-install. Supported values include `vscode`, `cursor`, `windsurf`, and `zed`. Defaults to no IDE (SSH only)"
691691
),
692692
] = None
693693
version: Annotated[

src/dstack/_internal/server/services/ides/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,15 @@
44
from dstack._internal.server.services.ides.cursor import CursorDesktop
55
from dstack._internal.server.services.ides.vscode import VSCodeDesktop
66
from dstack._internal.server.services.ides.windsurf import WindsurfDesktop
7+
from dstack._internal.server.services.ides.zed import ZedDesktop
78

8-
_IDELiteral = Literal["vscode", "cursor", "windsurf"]
9+
_IDELiteral = Literal["vscode", "cursor", "windsurf", "zed"]
910

1011
_ide_literal_to_ide_class_map: dict[_IDELiteral, type[IDE]] = {
1112
"vscode": VSCodeDesktop,
1213
"cursor": CursorDesktop,
1314
"windsurf": WindsurfDesktop,
15+
"zed": ZedDesktop,
1416
}
1517

1618

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
from typing import Optional
2+
3+
from dstack._internal.server.services.ides.base import IDE
4+
5+
6+
class ZedDesktop(IDE):
7+
name = "Zed"
8+
url_scheme = "zed"
9+
10+
def get_install_commands(
11+
self, version: Optional[str] = None, extensions: Optional[list[str]] = None
12+
) -> list[str]:
13+
# We don't need to pre-install any extensions for Zed so we let it
14+
# auto-install the remote server into ~/.zed_server on the first SSH connect,
15+
# downloading the binary that matches the connecting Zed client version.
16+
return []
17+
18+
def get_url(self, authority: str, working_dir: str) -> str:
19+
return f"zed://ssh/{authority}{working_dir}"

src/tests/_internal/core/models/test_configurations.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -817,6 +817,16 @@ def test_cursor_version_not_validated(self):
817817
assert params.ide == "cursor"
818818
assert params.version == "0.40.0"
819819

820+
def test_zed_ide_allowed(self):
821+
params = DevEnvironmentConfigurationParams(ide="zed")
822+
assert params.ide == "zed"
823+
assert params.version is None
824+
825+
def test_zed_version_not_validated(self):
826+
params = DevEnvironmentConfigurationParams(ide="zed", version="0.100.0")
827+
assert params.ide == "zed"
828+
assert params.version == "0.100.0"
829+
820830
def test_ide_optional(self):
821831
params = DevEnvironmentConfigurationParams()
822832
assert params.ide is None

0 commit comments

Comments
 (0)