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

Function generateCppProperties

src/cppProperties.ts:10–28  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

8import { extensionContext } from './extension';
9
10export async function generateCppProperties(): Promise<void> {
11 const currentWorkspaceFolder = getCurrentWorkspaceFolder()?.uri.fsPath;
12 if (currentWorkspaceFolder === undefined) {
13 void window.showWarningMessage('Please open a workspace folder to create c_cpp_properties.json');
14 return;
15 }
16 const outFilePath = path.join(currentWorkspaceFolder, '.vscode', 'c_cpp_properties.json');
17 if (fs.existsSync(outFilePath)) {
18 const overwrite = await window.showWarningMessage(
19 '"c_cpp_properties.json" file already exists. Do you want to overwrite?',
20 'Yes', 'No'
21 );
22 if (overwrite === 'No') {
23 return;
24 }
25 void fs.unlinkSync(outFilePath);
26 }
27 return generateCppPropertiesProc(currentWorkspaceFolder);
28}
29
30/** Helper: Return object depending on current process platform */
31function platformChoose<A, B, C>(win32: A, darwin: B, other: C): A | B | C {

Callers

nothing calls this directly

Calls 2

Tested by

no test coverage detected