generated from brevdev/seed
-
Notifications
You must be signed in to change notification settings - Fork 22
Add support for brev open code/cursor commands and default editor setting #238
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ting - Add cursor utilities in pkg/util/util.go with TryRunCursorCommand, InstallCursorExtension, etc. - Add personal settings management in pkg/files/files.go for storing default editor preference - Update open command to support 'brev open <workspace> <editor>' syntax - Add --set-default flag to configure default editor (code or cursor) - Remove broken --cursor flag in favor of argument-based approach - Maintain backward compatibility with existing 'brev open <workspace>' usage - Add proper error handling for invalid editor types and missing executables Co-Authored-By: Alec Fong <alecsanf@usc.edu>
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
- Remove unused store parameter from handleSetDefault function - Remove unused store parameter from determineEditorType function - Update function calls to match new signatures Co-Authored-By: Alec Fong <alecsanf@usc.edu>
Member
|
When I run the set default flow, I get the following error resulting in me not being able to set default |
- Replace static cobra.RangeArgs(1, 2) with custom validation function - Allow 0 arguments when --set-default flag is provided - Maintain 1-2 argument requirement for normal workspace operations - Resolves issue where 'brev open --set-default cursor' failed with arg validation error Co-Authored-By: Alec Fong <alecsanf@usc.edu>
Member
|
Setting the default ide results in a strange success error message |
- Change t.Vprintf to t.Printf to fix format string mismatch - Resolves malformed success message '%!!(string=cursor)s(MISSING)' - Success message now displays correctly as 'Default editor set to cursor' Co-Authored-By: Alec Fong <alecsanf@usc.edu>
- Terminal type doesn't have Printf method, only Print/Vprint/Vprintf - Use t.Vprint with string concatenation following codebase patterns - Resolves build error: 't.Printf undefined' Co-Authored-By: Alec Fong <alecsanf@usc.edu>
- Remove extra blank lines on lines 80 and 85 that violated gofumpt formatting rules - Resolves CI lint failure in 'ci (ubuntu-22.04)' check - All formatting now complies with gofumpt standards Co-Authored-By: Alec Fong <alecsanf@usc.edu>
- Run gofumpt on pkg/cmd/open/open.go to fix all formatting violations - Remove trailing spaces and fix indentation issues - Resolves remaining CI lint failure in 'ci (ubuntu-22.04)' check Co-Authored-By: Alec Fong <alecsanf@usc.edu>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add support for brev open code/cursor commands and default editor setting
Summary
This PR implements multi-editor support for the
brev opencommand, allowing users to explicitly choose between VSCode and Cursor, and set a default editor preference.Key Changes:
brev open <workspace> codeandbrev open <workspace> cursorbrev open --set-default <editor>to configure preferencebrev open <workspace>continues to work~/.brev/personal_settings.jsonBreaking Change: Removed the existing
--cursorflag (which was non-functional) in favor of the new argument-based approach.Review & Testing Checklist for Human
brev open <workspace>usage still worksbrev open <workspace> codeandbrev open <workspace> cursorwork correctlybrev open --set-default cursorpersists preference andbrev open <workspace>uses itRecommended Test Plan:
Diagram
%%{ init : { "theme" : "default" }}%% graph TB subgraph Legend L1["Major Edit"]:::major-edit L2["Minor Edit"]:::minor-edit L3["Context/No Edit"]:::context end OpenCmd["pkg/cmd/open/open.go<br/>Main command logic"]:::major-edit UtilPkg["pkg/util/util.go<br/>Editor utilities"]:::major-edit FilesPkg["pkg/files/files.go<br/>Settings management"]:::major-edit PersonalSettings["PersonalSettings struct<br/>Default editor storage"]:::minor-edit CursorUtils["Cursor utilities<br/>TryRunCursorCommand, etc."]:::minor-edit OpenCmd -->|"uses"| UtilPkg OpenCmd -->|"reads/writes"| FilesPkg FilesPkg -->|"contains"| PersonalSettings UtilPkg -->|"contains"| CursorUtils classDef major-edit fill:#90EE90 classDef minor-edit fill:#87CEEB classDef context fill:#FFFFFFNotes