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
Copy file name to clipboardExpand all lines: crates/rust-analyzer/src/diagnostics/snapshots/rust_analyzer__diagnostics__to_proto__tests__snap_multi_line_fix.snap
Copy file name to clipboardExpand all lines: crates/rust-analyzer/src/diagnostics/snapshots/rust_analyzer__diagnostics__to_proto__tests__snap_rustc_unused_variable.snap
If this capability is set, `CodeAction` returned from the server contain an additional field, `group`:
128
+
129
+
```typescript
130
+
interfaceCodeAction {
131
+
title:string;
132
+
group?:string;
133
+
...
134
+
}
135
+
```
136
+
137
+
All code-actions with the same `group` should be grouped under single (extendable) entry in lightbulb menu.
138
+
The set of actions `[ { title: "foo" }, { group: "frobnicate", title: "bar" }, { group: "frobnicate", title: "baz" }]` should be rendered as
139
+
140
+
```
141
+
💡
142
+
+-------------+
143
+
| foo |
144
+
+-------------+-----+
145
+
| frobnicate >| bar |
146
+
+-------------+-----+
147
+
| baz |
148
+
+-----+
149
+
```
150
+
151
+
Alternatively, selecting `frobnicate` could present a user with an additional menu to choose between `bar` and `baz`.
152
+
153
+
### Example
154
+
155
+
```rust
156
+
fnmain() {
157
+
letx:Entry/*cursor here*/=todo!();
158
+
}
159
+
```
160
+
161
+
Invoking code action at this position will yield two code actions for importing `Entry` from either `collections::HashMap` or `collection::BTreeMap`, grouped under a single "import" group.
162
+
163
+
### Unresolved Questions
164
+
165
+
* Is a fixed two-level structure enough?
166
+
* Should we devise a general way to encode custom interaction protocols for GUI refactorings?
0 commit comments