-
Notifications
You must be signed in to change notification settings - Fork 1
/
gen_hints.sh
executable file
·39 lines (35 loc) · 1.03 KB
/
gen_hints.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/bash
set -e
###
# setup environment and type hints for vscode
###
WORK_DIR=$(readlink -f .)
SCRIPT_DIR=$(readlink -f ./scripts)
CPYTHON_BIN_PATH=$(readlink -f ./cpython_bin/include/python3.*)
echo '''
{
"configurations": [
{
"name": "Linux",
"includePath": [
"${workspaceFolder}/**",
"'$CPYTHON_BIN_PATH'/",
"'$CPYTHON_BIN_PATH'/internal"
],
"defines": [],
"compilerPath": "'$(nix-shell --pure --command "echo \$CLANG_BIN" $SCRIPT_DIR/cpython.nix)'",
"cStandard": "c17",
"cppStandard": "c++17",
"intelliSenseMode": "linux-clang-x64"
}
],
"version": 4
}
''' > $WORK_DIR/.vscode/c_cpp_properties.json
echo '''
{
"cmake.sourceDirectory": "${workspaceFolder}/src",
"cmake.buildDirectory": "${workspaceFolder}/build",
"C_Cpp.default.compilerPath": "'$(nix-shell --pure --command "echo \$CLANG_BIN" $SCRIPT_DIR/cpython.nix)'"
}
''' > $WORK_DIR/.vscode/settings.json