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

Function navigateToFile

src/rstudioapi.ts:167–174  ·  view source on GitHub ↗
(file: string, line: number, column: number)

Source from the content-addressed store, hash-verified

165}
166
167export async function navigateToFile(file: string, line: number, column: number): Promise<void>{
168
169 const targetDocument = await workspace.openTextDocument(Uri.file(file));
170 const editor = await window.showTextDocument(targetDocument);
171 const targetPosition = parsePosition([line, column], targetDocument);
172 editor.selection = new Selection(targetPosition, targetPosition);
173 editor.revealRange(new Range(targetPosition, targetPosition));
174}
175
176export async function setSelections(ranges: number[][], id: string): Promise<void> {
177 // Setting selections can only be done on TextEditors not TextDocuments, but

Callers 1

dispatchRStudioAPICallFunction · 0.85

Calls 1

parsePositionFunction · 0.85

Tested by

no test coverage detected