@@ -36,6 +36,16 @@ it.layer(NodeServices.layer)("resolveEditorLaunch", (it) => {
3636 args : [ "/tmp/workspace" ] ,
3737 } ) ;
3838
39+ const windsurfLaunch = yield * resolveEditorLaunch (
40+ { cwd : "/tmp/workspace" , editor : "windsurf" } ,
41+ "darwin" ,
42+ { PATH : "" } ,
43+ ) ;
44+ assert . deepEqual ( windsurfLaunch , {
45+ command : "windsurf" ,
46+ args : [ "/tmp/workspace" ] ,
47+ } ) ;
48+
3949 const traeLaunch = yield * resolveEditorLaunch (
4050 { cwd : "/tmp/workspace" , editor : "trae" } ,
4151 "darwin" ,
@@ -225,6 +235,16 @@ it.layer(NodeServices.layer)("resolveEditorLaunch", (it) => {
225235 args : [ "--goto" , "/tmp/workspace/src/open.ts:71:5" ] ,
226236 } ) ;
227237
238+ const windsurfLineAndColumn = yield * resolveEditorLaunch (
239+ { cwd : "/tmp/workspace/src/open.ts:71:5" , editor : "windsurf" } ,
240+ "darwin" ,
241+ { PATH : "" } ,
242+ ) ;
243+ assert . deepEqual ( windsurfLineAndColumn , {
244+ command : "windsurf" ,
245+ args : [ "--goto" , "/tmp/workspace/src/open.ts:71:5" ] ,
246+ } ) ;
247+
228248 const traeLineAndColumn = yield * resolveEditorLaunch (
229249 { cwd : "/tmp/workspace/src/open.ts:71:5" , editor : "trae" } ,
230250 "darwin" ,
@@ -411,6 +431,29 @@ it.layer(NodeServices.layer)("resolveEditorLaunch", (it) => {
411431 } ) ,
412432 ) ;
413433
434+ it . effect ( "falls back to surf when windsurf is not installed" , ( ) =>
435+ Effect . gen ( function * ( ) {
436+ const fs = yield * FileSystem . FileSystem ;
437+ const path = yield * Path . Path ;
438+ const dir = yield * fs . makeTempDirectoryScoped ( { prefix : "t3-open-test-" } ) ;
439+ yield * fs . writeFileString ( path . join ( dir , "surf" ) , "#!/bin/sh\nexit 0\n" ) ;
440+ yield * fs . chmod ( path . join ( dir , "surf" ) , 0o755 ) ;
441+
442+ const result = yield * resolveEditorLaunch (
443+ { cwd : "/tmp/workspace" , editor : "windsurf" } ,
444+ "linux" ,
445+ {
446+ PATH : dir ,
447+ } ,
448+ ) ;
449+
450+ assert . deepEqual ( result , {
451+ command : "surf" ,
452+ args : [ "/tmp/workspace" ] ,
453+ } ) ;
454+ } ) ,
455+ ) ;
456+
414457 it . effect ( "falls back to zeditor when zed is not installed" , ( ) =>
415458 Effect . gen ( function * ( ) {
416459 const fs = yield * FileSystem . FileSystem ;
@@ -576,6 +619,7 @@ it.layer(NodeServices.layer)("resolveAvailableEditors", (it) => {
576619
577620 yield * fs . writeFileString ( path . join ( dir , "trae.CMD" ) , "@echo off\r\n" ) ;
578621 yield * fs . writeFileString ( path . join ( dir , "kiro.CMD" ) , "@echo off\r\n" ) ;
622+ yield * fs . writeFileString ( path . join ( dir , "windsurf.CMD" ) , "@echo off\r\n" ) ;
579623 yield * fs . writeFileString ( path . join ( dir , "code-insiders.CMD" ) , "@echo off\r\n" ) ;
580624 yield * fs . writeFileString ( path . join ( dir , "codium.CMD" ) , "@echo off\r\n" ) ;
581625 yield * fs . writeFileString ( path . join ( dir , "aqua.CMD" ) , "@echo off\r\n" ) ;
@@ -595,6 +639,7 @@ it.layer(NodeServices.layer)("resolveAvailableEditors", (it) => {
595639 PATHEXT : ".COM;.EXE;.BAT;.CMD" ,
596640 } ) ;
597641 assert . deepEqual ( editors , [
642+ "windsurf" ,
598643 "trae" ,
599644 "kiro" ,
600645 "vscode-insiders" ,
0 commit comments