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

Function activeEditorContext

src/rstudioapi.ts:94–108  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

92
93//rstudioapi
94export function activeEditorContext() {
95 // info returned from RStudio:
96 // list with:
97 // id
98 // path
99 // contents
100 // selection - a list of selections
101 const currentDocument = getLastActiveTextEditor().document;
102 return {
103 id: currentDocument.uri,
104 contents: currentDocument.getText(),
105 path: currentDocument.fileName,
106 selection: getLastActiveTextEditor().selections
107 };
108}
109
110export async function documentContext(id: string) {
111 const target = findTargetUri(id);

Callers 1

dispatchRStudioAPICallFunction · 0.85

Calls 1

getLastActiveTextEditorFunction · 0.85

Tested by

no test coverage detected