MCPcopy Create free account
hub / github.com/REditorSupport/vscode-R / replaceTextInCurrentSelection

Function replaceTextInCurrentSelection

src/rstudioapi.ts:149–159  ·  view source on GitHub ↗
(text: string, id: string)

Source from the content-addressed store, hash-verified

147}
148
149export async function replaceTextInCurrentSelection(text: string, id: string): Promise<void> {
150 const target = findTargetUri(id);
151 console.info(`[replaceTextInCurrentSelection] inserting: ${text} into ${target.path}`);
152 const edit = new WorkspaceEdit();
153 edit.replace(
154 target,
155 getLastActiveTextEditor().selection,
156 text
157 );
158 await workspace.applyEdit(edit);
159}
160
161export function showDialog(message: string): void {
162

Callers 1

dispatchRStudioAPICallFunction · 0.85

Calls 2

findTargetUriFunction · 0.85
getLastActiveTextEditorFunction · 0.85

Tested by

no test coverage detected