()
| 92 | |
| 93 | //rstudioapi |
| 94 | export 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 | |
| 110 | export async function documentContext(id: string) { |
| 111 | const target = findTargetUri(id); |
no test coverage detected