MCPcopy Index your code
hub / github.com/REditorSupport/vscode-R / collectRLinkingTo

Function collectRLinkingTo

src/cppProperties.ts:116–130  ·  view source on GitHub ↗
(workspaceFolder: string)

Source from the content-addressed store, hash-verified

114}
115
116async 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
132function ensureUnquoted(str: string): string {
133 if (/(^".*"$)|(^'.*'$)/.test(str)) {

Callers 1

Calls 1

executeRCommandFunction · 0.90

Tested by

no test coverage detected