(workspaceFolder: string)
| 114 | } |
| 115 | |
| 116 | async function collectRLinkingTo(workspaceFolder: string): Promise<string[]> { |
| 117 | if (!fs.existsSync(path.join(workspaceFolder, 'DESCRIPTION'))) { |
| 118 | return []; |
| 119 | } |
| 120 | |
| 121 | const rScript = extensionContext.asAbsolutePath('R/cppProperties/extractLinkingTo.R').replace(/\\/g, '/'); |
| 122 | const linkingToIncludesStr = (await executeRCommand(`source('${rScript}')`, workspaceFolder, (e: Error) => { |
| 123 | void window.showErrorMessage(e.message); |
| 124 | return ''; |
| 125 | }))?.trim(); |
| 126 | if (!linkingToIncludesStr || linkingToIncludesStr === '') { |
| 127 | return []; |
| 128 | } |
| 129 | return linkingToIncludesStr.split(/\r?\n/g).map(decodeURI); |
| 130 | } |
| 131 | |
| 132 | function ensureUnquoted(str: string): string { |
| 133 | if (/(^".*"$)|(^'.*'$)/.test(str)) { |
no test coverage detected