Skip to content

Commit 6523482

Browse files
authored
Improve "extract" action for Python (#2328)
Now that microsoft/pylance-release#3803 has shipped ## Checklist - [-] I have added [tests](https://www.cursorless.org/docs/contributing/test-case-recorder/) - [-] I have updated the [docs](https://github.com/cursorless-dev/cursorless/tree/main/docs) and [cheatsheet](https://github.com/cursorless-dev/cursorless/tree/main/cursorless-talon/src/cheatsheet) - [-] I have not broken the cheatsheet
1 parent d60ad92 commit 6523482

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

packages/cursorless-vscode/src/ide/vscode/VscodeTextEditorImpl.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -187,13 +187,9 @@ export class VscodeTextEditorImpl implements EditableTextEditor {
187187

188188
public async extractVariable(_range?: Range): Promise<void> {
189189
if (this.document.languageId === "python") {
190-
// Workaround for https://github.com/microsoft/vscode-python/issues/20455
191190
await vscode.commands.executeCommand("editor.action.codeAction", {
192-
kind: "refactor.extract",
191+
kind: "refactor.extract.variable",
193192
});
194-
await sleep(250);
195-
await vscode.commands.executeCommand("selectNextCodeAction");
196-
await vscode.commands.executeCommand("acceptSelectedCodeAction");
197193
} else {
198194
await vscode.commands.executeCommand("editor.action.codeAction", {
199195
kind: "refactor.extract.constant",

0 commit comments

Comments
 (0)