1,sudo gedit /usr/bin/code
修改ELECTRON_RUN_AS_NODE=1 "$ELECTRON" "$CLI" "$@"为:
ELECTRON_RUN_AS_NODE=1 "$ELECTRON" "$CLI" "$@" --user-data-dir=/home/Flying_Motor/hdd/.cache/code-cache
2,sudo gedit /usr/share/applications/code.desktop
修改Exec=/usr/share/code/code --unity-launch %F为:
Exec=/usr/share/code/code --unity-launch --user-data-dir=/home/Flying_Motor/hdd/.cache/code-cache %F
修改Exec=/usr/share/code/code --new-window %F为:
Exec=/usr/share/code/code --new-window --user-data-dir=/home/Flying_Motor/hdd/.cache/code-cache %F
3,如果使用C++扩展,也可以修改C++扩展缓存位置
默认C_Cpp: Intelli Sense Cache Path设置项为空,也就是使用默认缓存位置。
在setting中搜索“C_Cpp: Intelli Sense Cache Path”,填入自己想要的位置即可。