Skip to content

Commit d367094

Browse files
committed
Remove deprecated PowerShell.ApplyCodeActionEdits
This is no longer necessary as edits are constructed by the server and sent over LSP.
1 parent 3c3d1dd commit d367094

File tree

1 file changed

+5
-17
lines changed

1 file changed

+5
-17
lines changed

src/features/CodeActions.ts

+5-17
Original file line numberDiff line numberDiff line change
@@ -2,36 +2,24 @@
22
// Licensed under the MIT License.
33

44
import vscode = require("vscode");
5-
import Window = vscode.window;
65
import { ILogger } from "../logging";
76

87
export class CodeActionsFeature implements vscode.Disposable {
9-
private applyEditsCommand: vscode.Disposable;
108
private showDocumentationCommand: vscode.Disposable;
119

1210
constructor(private log: ILogger) {
13-
// TODO: What type is `edit`, what uses this, and is it working?
14-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
15-
this.applyEditsCommand = vscode.commands.registerCommand("PowerShell.ApplyCodeActionEdits", async (edit: any) => {
16-
await Window.activeTextEditor?.edit((editBuilder) => {
17-
editBuilder.replace(
18-
new vscode.Range(
19-
edit.StartLineNumber - 1,
20-
edit.StartColumnNumber - 1,
21-
edit.EndLineNumber - 1,
22-
edit.EndColumnNumber - 1),
23-
edit.Text);
24-
});
25-
});
26-
11+
// NOTE: While not exposed to the user via package.json, this is
12+
// required as the server's code action sends across a command name.
13+
//
14+
// TODO: In the far future with LSP 3.19 the server can just set a URL
15+
// and this can go away. See https://github.com/microsoft/language-server-protocol/issues/1548
2716
this.showDocumentationCommand =
2817
vscode.commands.registerCommand("PowerShell.ShowCodeActionDocumentation", async (ruleName: string) => {
2918
await this.showRuleDocumentation(ruleName);
3019
});
3120
}
3221

3322
public dispose(): void {
34-
this.applyEditsCommand.dispose();
3523
this.showDocumentationCommand.dispose();
3624
}
3725

0 commit comments

Comments
 (0)