MCPcopy Create free account
hub / github.com/Dart-Code/Dart-Code / executeCodeAction

Function executeCodeAction

src/test/helpers.ts:726–730  ·  view source on GitHub ↗
({ kind, title }: { kind?: vs.CodeActionKind, title?: string }, range: vs.Range)

Source from the content-addressed store, hash-verified

724}
725
726export async function executeCodeAction({ kind, title }: { kind?: vs.CodeActionKind, title?: string }, range: vs.Range) {
727 const matchingActions = await getCodeActions({ kind, title, requireExactlyOne: true }, range);
728 assert.equal(matchingActions.length, 1);
729 await waitForEditorChange(() => vs.commands.executeCommand(matchingActions[0].command!.command, ...matchingActions[0].command!.arguments!)); // eslint-disable-line @typescript-eslint/no-unsafe-argument
730}
731
732export function positionOf(searchText: string, doc?: vs.TextDocument): vs.Position {
733 // Normalise search text to match the document, since our literal template

Calls 3

getCodeActionsFunction · 0.85
waitForEditorChangeFunction · 0.85
executeCommandMethod · 0.65

Tested by

no test coverage detected