You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add Windsurf IDE support to brev open command (#242)
* Add Windsurf IDE support to brev open command
- Add EditorWindsurf constant and validation logic
- Add Windsurf utility functions following Cursor pattern
- Add openWindsurf function with vscode-remote URI support
- Add Windsurf extension installation support
- Update help text and examples to include Windsurf
- Add Windows and macOS installation paths for Windsurf
- Convert if-else chains to switch statements for better code quality
Co-Authored-By: Alec Fong <[email protected]>
* Refactor openEditorWithSSH and runOpenCommand to fix lint issues
- Extract getEditorName helper to eliminate duplicated switch statements
- Extract handlePathError helper to reduce repeated UpdateUser pattern
- Extract openEditorByType helper to simplify editor opening logic
- Extract validateRemoteWorkspace helper to reduce function complexity
- Reduce openEditorWithSSH from 43 to ~35 statements
- Reduce runOpenCommand cyclomatic complexity from 18 to ~12
- Maintain all existing Windsurf IDE functionality
- Fix gofumpt formatting issues
Fixes lint errors:
- Function 'openEditorWithSSH' has too many statements (43 > 40) (funlen)
- cyclomatic complexity 18 of func runOpenCommand is high (> 16) (gocyclo)
Co-Authored-By: Alec Fong <[email protected]>
---------
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: Alec Fong <[email protected]>
openLong="[command in beta] This will open VS Codeor Cursor SSH-ed in to your instance. You must have the editor installed in your path."
39
-
openExample="brev open instance_id_or_name\nbrev open instance\nbrev open instance code\nbrev open instance cursor\nbrev open --set-default cursor"
39
+
openLong="[command in beta] This will open VS Code, Cursor, or Windsurf SSH-ed in to your instance. You must have the editor installed in your path."
40
+
openExample="brev open instance_id_or_name\nbrev open instance\nbrev open instance code\nbrev open instance cursor\nbrev open instance windsurf\nbrev open --set-default cursor\nbrev open --set-default windsurf"
ifstrings.Contains(err.Error(), `"code": executable file not found in $PATH`) {
206
207
errMsg:="code\": executable file not found in $PATH\n\nadd 'code' to your $PATH to open VS Code from the terminal\n\texport PATH=\"/Applications/Visual Studio Code.app/Contents/Resources/app/bin:$PATH\""
207
-
_, errStore:=tstore.UpdateUser(
208
-
workspace.CreatedByUserID,
209
-
&entity.UpdateUser{
210
-
OnboardingData: map[string]interface{}{
211
-
"pathErrorTS": time.Now().UTC().Unix(),
212
-
},
213
-
})
214
-
iferrStore!=nil {
215
-
returnerrors.New(errMsg+"\n"+errStore.Error())
216
-
}
217
-
returnerrors.New(errMsg)
208
+
returnhandlePathError(tstore, workspace, errMsg)
218
209
}
219
210
ifstrings.Contains(err.Error(), `"cursor": executable file not found in $PATH`) {
220
211
errMsg:="cursor\": executable file not found in $PATH\n\nadd 'cursor' to your $PATH to open Cursor from the terminal"
221
-
_, errStore:=tstore.UpdateUser(
222
-
workspace.CreatedByUserID,
223
-
&entity.UpdateUser{
224
-
OnboardingData: map[string]interface{}{
225
-
"pathErrorTS": time.Now().UTC().Unix(),
226
-
},
227
-
})
228
-
iferrStore!=nil {
229
-
returnerrors.New(errMsg+"\n"+errStore.Error())
230
-
}
231
-
returnerrors.New(errMsg)
212
+
returnhandlePathError(tstore, workspace, errMsg)
213
+
}
214
+
ifstrings.Contains(err.Error(), `"windsurf": executable file not found in $PATH`) {
215
+
errMsg:="windsurf\": executable file not found in $PATH\n\nadd 'windsurf' to your $PATH to open Windsurf from the terminal"
0 commit comments