MCPcopy Create free account
hub / github.com/microsoft/vscode-extension-samples / createFix

Method createFix

code-actions-sample/src/extension.ts:71–76  ·  view source on GitHub ↗
(document: vscode.TextDocument, range: vscode.Range, emoji: string)

Source from the content-addressed store, hash-verified

69 }
70
71 private createFix(document: vscode.TextDocument, range: vscode.Range, emoji: string): vscode.CodeAction {
72 const fix = new vscode.CodeAction(`Convert to ${emoji}`, vscode.CodeActionKind.QuickFix);
73 fix.edit = new vscode.WorkspaceEdit();
74 fix.edit.replace(document.uri, new vscode.Range(range.start, range.start.translate(0, 2)), emoji);
75 return fix;
76 }
77
78 private createCommand(): vscode.CodeAction {
79 const action = new vscode.CodeAction('Learn more...', vscode.CodeActionKind.Empty);

Callers 1

provideCodeActionsMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected