Repository navigation
Vscode persistence - #282
Conversation
8b23e4e to
a675a45
Compare
a675a45 to
ee64429
Compare
| } | ||
| return errors.New(errorMsg) | ||
| // GetSetupCommand returns the setup command with IDE_NAME as argument | ||
| func GetSetupCommand() components.Command { |
There was a problem hiding this comment.
let's not make a separate methods to get command components , can be done like this
func GetCommands() []components.Command { return []components.Command{ { Name: "setup", Description: setup.GetDescription(), Arguments: setup.GetArguments(), Flags: commands.GetSetupFlags(), Action: setupCmd, Aliases: []string{"s"}, Category: ideCategory, }, } }
There was a problem hiding this comment.
ok will update this
| return errors.New(errorMsg) | ||
| } | ||
|
|
||
| func getSetupArguments() []components.Argument { |
There was a problem hiding this comment.
move this to help doc section for ide and then use it like this in command components
Description: setup.GetDescription(), Arguments: setup.GetArguments(),
There was a problem hiding this comment.
great point, will update this.
| return errors.New("IDE_NAME is required. Usage: jf ide setup <IDE_NAME>\nSupported IDEs: vscode, cursor, windsurf, jetbrains") | ||
| } | ||
|
|
||
| ideName := strings.ToLower(c.GetArgumentAt(0)) |
There was a problem hiding this comment.
we should not convert the ide name to lower case and validate , it should fail in case the command is jf ide setup VSCODE
There was a problem hiding this comment.
Sorry I didn't get the second line, can you pls elaborate this point.
| return []string{commands.IdeVSCode, commands.IdeJetBrains} | ||
| func setupCmd(c *components.Context) error { | ||
| if c.GetNumberOfArgs() == 0 { | ||
| return errors.New("IDE_NAME is required. Usage: jf ide setup <IDE_NAME>\nSupported IDEs: vscode, cursor, windsurf, jetbrains") |
There was a problem hiding this comment.
i think for now only vscode and jetbrains are supported , please confirm this
There was a problem hiding this comment.
This PR, I have also added support for cursor and windsurf.
| return append(flags, ideSpecificFlags...) | ||
| } | ||
|
|
||
| func supportedIDEs() []string { |
There was a problem hiding this comment.
why did we removed this method can we not use it and instead of adding every the suported ide's we can just use this unified method which will have the list of all the supported ide's
There was a problem hiding this comment.
great point, added this method.
| sudo jf ide setup %s --repo-key <your-repo-key> | ||
|
|
||
| Or with direct URL: | ||
| sudo jf ide setup %s '%s' |
There was a problem hiding this comment.
why have we added %s two times?
There was a problem hiding this comment.
sudo jf ide setup %s '%s'
↑ ↑
│ └─ serviceURL
└───── ideName
|
|
||
| // createBackup creates a backup of product.json | ||
| func (vc *VSCodeForkCommand) createBackup() error { | ||
| timestamp := time.Now().Format("20060102_150405") |
There was a problem hiding this comment.
can you please check if this format is correct and the required timstamp format
| } | ||
|
|
||
| // validateRepository validates that the repository exists and is the correct type | ||
| func (vc *VSCodeForkCommand) validateRepository() error { |
There was a problem hiding this comment.
i think we have the same method for validating repository in jetbrains as well can you please check and make sure we don't have redundant code, let's make it exported and use it
| DisplayName string // User-facing name (e.g., "Visual Studio Code", "Cursor") | ||
| InstallPaths map[string][]string // OS -> possible installation paths | ||
| ProductJson string // Relative path to product.json (usually just "product.json") | ||
| SettingsDir string // Settings directory name (e.g., "Code", "Cursor") |
There was a problem hiding this comment.
let's remove these comments from struct fields
| } | ||
|
|
||
| // ValidateRepository validates that the repository exists and is of the specified type | ||
| func ValidateRepository(repoKey string, rtDetails *config.ServerDetails, apiType string) error { |
There was a problem hiding this comment.
we already have ValidateRepository method in other files and we just use this one everywhere
There was a problem hiding this comment.
Will update this thanks
| return fmt.Errorf("repository '%s' is not of type '%s': %w", repoKey, apiType, err) | ||
| } | ||
|
|
||
| log.Info("Repository validation successful") |
There was a problem hiding this comment.
| log.Info("Repository validation successful") | |
| log.Debug("Repository validation successful") |
Introduced a new IDE integration system for configuring VSCode-based editors (VSCode, Cursor, Windsurf) and JetBrains IDEs to use JFrog Artifactory as their extension/plugin marketplace.
New Commands
Architecture & Design Patterns
1. Configuration-Based Design (VSCode Forks)
Uses a registry pattern to handle multiple VSCode-based IDEs with a single implementation:
2. Common Package Pattern
Extracted shared logic into
ide/common/to eliminate duplication:3. Unified Command Structure
Single
setupcommand with IDE name as argument:Routing:
📁 Final Structure
Technical Details
API Types
aieditorextensions- VSCode, Cursor, Windsurf (all VSCode forks)jetbrainsplugins- IntelliJ, PyCharm, WebStorm, etc.VSCode Fork Registry
Common Package Functions
CLI Common Flags
Notes
product.jsonand optionallysettings.jsonidea.propertiesfilesRelated PRs