Skip to content

Commit 54bdbe6

Browse files
committed
Auto-edit for JetBrains docs
1 parent b40eeb3 commit 54bdbe6

File tree

1 file changed

+84
-23
lines changed

1 file changed

+84
-23
lines changed

docs/cody/capabilities/auto-edit.mdx

Lines changed: 84 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<p className="subtitle">Auto-edit suggests code changes by analyzing cursor movements and typing. After you've made at least one character edit in your codebase, it begins proposing contextual modifications based on your cursor position and recent changes.</p>
44

5-
<Callout type="info">Auto-edit is currently supported in the VS Code extension with Sourcegraph v6.0+. It's available in Beta for Pro, Enterprise Starter and Enterprise users on Cody Gateway. Auto-edit requires Fireworks to be enabled as a provider. Enterprise customers without Fireworks enabled can [disable the feature flag](#auto-edit-access-for-enterprise-customers)</Callout>
5+
<Callout type="info">Auto-edit is currently supported with Sourcegraph v6.0+ for Pro, Enterprise Starter, and Enterprise accounts on Cody Gateway. Auto-edit requires Fireworks to be enabled as a provider. Enterprise customers without Fireworks enabled can disable the feature flag.</Callout>
66

77
## Capabilities of auto-edit
88

@@ -12,9 +12,45 @@
1212
- Can propose similar changes across multiple locations based on recent edits
1313
- Can handle complex refactoring operations like adding parameters and unpacking functions
1414

15-
## Enabling auto-edit
15+
## How does auto-edit work?
16+
17+
The system detects potential changes based on the following:
18+
19+
- Cursor placement in the code
20+
- Recent changes made in similar contexts
21+
- Function usage patterns
22+
- Common refactoring patterns
23+
24+
## Auto-edit vs. Autocomplete
25+
26+
In terms of feature set and functionality, auto-edit and autocomplete have some key differences:
27+
28+
| **Feature** | **Autocomplete** | **Auto-edit** |
29+
| ---------------------- | -------------------------------------- | -------------------------------------------------- |
30+
| **Text modification** | Can only insert text, not delete | Can both insert and delete text |
31+
| **Cursor position** | Only proposes content after the cursor | Can modify code before and after the cursor |
32+
| **Suggestion trigger** | Suggests on every character typed | Proposes changes based on context and recent edits |
33+
34+
## Use cases
35+
36+
The auto-edit feature can help you with various repetitive tasks in your code:
1637

17-
Auto-edit is enabled by default for Cody Pro Enterprise Starter, and Enterprise users. You can opt out and switch back to **autocomplete** by selecting it from the suggestion mode in the Cody VS Code extension settings.
38+
- **Function signature refactoring**: Automatically suggests adding error returns, new parameters, or changing return types across function definitions. For example, when you modify a function to return both a value and an error, auto-edit helps update the function signature.
39+
- **Call site updates**: When you change a function's signature, auto-edit detects all locations where the function is called and suggests necessary modifications to match the new signature. This includes updating parameter orders, adding error handling, and adjusting return value usage.
40+
- **Test file maintenance**: Helps with repetitive updates in test files, such as modifying test assertions, updating mock objects, or changing test data structures. Auto-edit recognizes patterns from your recent changes and suggests similar modifications across related tests.
41+
- **Parameter refactoring**: Assists in adding, removing, or reorganizing function parameters. When you unpack a function to handle more cases, auto-edit helps restructure the parameter list and suggests corresponding changes at call sites.
42+
- **Type system modifications**: Auto-edit identifies and suggests consistent changes across your codebase when updating type definitions or interfaces. This includes updating variable declarations, function parameters, and return types to maintain type consistency.
43+
44+
Auto-edit is supported by both Cody VS Code and JetBrains plugins.
45+
46+
<Tabs>
47+
<Tab title="VS Code">
48+
49+
<Callout type="info">Auto-edit for VS Code is currently in Beta. It's available for Pro, Enterprise Starter, and Enterprise users on Cody Gateway. Auto-edit requires Fireworks to be enabled as a provider. Enterprise customers without Fireworks enabled can disable the feature flag.</Callout>
50+
51+
## Enabling auto-edit in VS Code
52+
53+
Auto-edit is enabled by default for Cody Pro Enterprise Starter and Enterprise users. You can opt out and switch back to autocomplete by selecting it from the suggestion mode in the Cody VS Code extension settings.
1854

1955
Site admins can opt their organization out of the auto-edit feature by disabling it from their config settings.
2056

@@ -53,31 +89,56 @@ The following example demonstrates how to add Fireworks as an allowed LLM provid
5389
}
5490
```
5591

56-
## How does auto-edit work?
92+
</Tab>
5793

58-
The system detects potential changes based on the following:
94+
<Tab title="JetBrains">
5995

60-
- Cursor placement in the code
61-
- Recent changes made in similar contexts
62-
- Function usage patterns
63-
- Common refactoring patterns
96+
<Callout type="info">Auto-edit for JetBrains IDEs is Experimental and supports JetBrains versions 7.84.0+. It's available for Pro, Enterprise Starter, and Enterprise users on Cody Gateway. Auto-edit requires Fireworks to be enabled as a provider. Enterprise customers without Fireworks enabled can disable the feature flag.</Callout>
6497

65-
## Auto-edit vs. Autocomplete
98+
## Enabling auto-edit in JetBrains
6699

67-
In terms of feature-set and functionality, auto-edit and autocomplete have some key differences:
100+
You can opt-in the auto-edit feature from the JetBrains Cody plugin settings.
68101

69-
| **Feature** | **Autocomplete** | **Auto-edit** |
70-
| ---------------------- | -------------------------------------- | -------------------------------------------------- |
71-
| **Text modification** | Can only insert text, not delete | Can both insert and delete text |
72-
| **Cursor position** | Only proposes content after the cursor | Can modify code before and after the cursor |
73-
| **Suggestion trigger** | Suggests on every character typed | Proposes changes based on context and recent edits |
102+
- Click the three-dot menu on the top right of the Cody plugin window and select **Open Cody Settings Editor**
103+
- This will open the `cody_settings.json` file in your editor
104+
- Here, add `"cody.suggestions.mode": "auto-edit (Beta)"` setting to enable the auto-edit feature
74105

75-
## Use cases
106+
![JetBrains-Cody-Settings-Editor](https://storage.googleapis.com/sourcegraph-assets/Docs/jb-cody-settings.png)
76107

77-
The auto-edit feature can help you with various repetitive tasks in your code:
108+
### Auto-edit access for Enterprise customers
78109

79-
- **Function signature refactoring**: Automatically suggests adding error returns, new parameters, or changing return types across function definitions. For example, when you modify a function to return both a value and an error, auto-edit helps update the function signature.
80-
- **Call site updates**: When you change a function's signature, auto-edit detects all locations where the function is called and suggests necessary modifications to match the new signature. This includes updating parameter orders, adding error handling, and adjusting return value usage.
81-
- **Test file maintenance**: Helps with repetitive updates in test files, such as modifying test assertions, updating mock objects, or changing test data structures. Auto-edit recognizes patterns from your recent changes and suggests similar modifications across related tests.
82-
- **Parameter refactoring**: Assists in adding, removing, or reorganizing function parameters. When you unpack a function to handle more cases, auto-edit helps restructure the parameter list and suggests corresponding changes at call sites.
83-
- **Type system modifications**: Auto-edit identifies and suggests consistent changes across your codebase when updating type definitions or interfaces. This includes updating variable declarations, function parameters, and return types to maintain type consistency.
110+
Auto-edit is available for Enterprise customers with [Sourcegraph Cody Gateway](/cody/core-concepts/cody-gateway#sourcegraph-cody-gateway) access. Enabling the feature requires two steps:
111+
112+
1. Site administrators must:
113+
- Ensure the feature flag `cody-autoedit-experiment-enabled-flag` is enabled (enabled by default)
114+
- Add `fireworks::*` as an [allowed provider](https://sourcegraph.com/docs/cody/enterprise/model-configuration#model-filters) (see below)
115+
2. Once enabled, auto-edit will become the default suggestion mode for all users
116+
3. Users can optionally switch back to autocomplete from the Cody extension settings
117+
4. Site admins can opt out of auto-edits using the `cody-autoedit-experiment-enabled-flag` feature flag
118+
119+
The following example demonstrates how to add Fireworks as an allowed LLM provider:
120+
121+
```json
122+
123+
"cody.enabled": true,
124+
"modelConfiguration": {
125+
"sourcegraph": {
126+
"modelFilters": {
127+
// Only allow "beta" and "stable" models.
128+
// Not "experimental" or "deprecated".
129+
"statusFilter": ["beta", "stable"],
130+
131+
// Allow any models provided by Anthropic, OpenAI, Google and Fireworks.
132+
"allow": [
133+
"anthropic::*", // Anthropic models
134+
"openai::*", // OpenAI models
135+
"google::*", // Google Gemini models
136+
"fireworks::*", // Open source models hosted by Sourcegraph
137+
],
138+
}
139+
}
140+
}
141+
```
142+
143+
</Tab>
144+
</Tabs>

0 commit comments

Comments
 (0)