Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Custom Command: set userConfigFile on runtime (#3179)
CONTEXT: https://sourcegraph.slack.com/archives/C05MW2TMYAV/p1707992847314209 **NOTE:** No Changelog entry needed as this is a recent change that's not included in stable yet. Previously, userConfigFile was initialized using this.configFileName but did not get updated when this.configFileName changed at runtime (init()). Now it is set dynamically based on the runtime config. workspaceConfigFile was already using this.configFileName dynamically. Make userConfigFile consistent by also setting it dynamically based on runtime config. This allows custom commands to be configured separately for the agent and editor. ### Note We use separate config files (.cody/commands.json and .vscode/cody.json) for the Cody agent and VS Code for configuration Custom Commands right now, with a plan to migrate the one VS Code used into `.cody/commands.json` in the near future. ## Test plan <!-- Required. See https://sourcegraph.com/docs/dev/background-information/testing_principles. --> - Added new e2e test coverage to make sure the correct file name is used for both workspace and User settings. - All the current tests on agent are still passing. ###.Step to reproduce: Open the Custom Commands Menu from the sidebar to select `Configure Custom Commands`: ![image](https://github.com/sourcegraph/cody/assets/68532117/1e65f8cc-8224-44a2-a982-8e4aeaab6165) Then `Open User Settings`: ![image](https://github.com/sourcegraph/cody/assets/68532117/9f09d546-9353-476a-b190-f0aa71e460e9) After, It should open `cody.json` for you: ![image](https://github.com/sourcegraph/cody/assets/68532117/d1449e39-c5fa-4606-b0b9-2f813d3d7e67) Before, it would open `commands.json`: ![image](https://github.com/sourcegraph/cody/assets/68532117/a12ac734-cc24-4922-a37f-5d3275c77195) --------- Co-authored-by: Tom Ross <[email protected]>
- Loading branch information