vscode 设置和引用变量
https://code.visualstudio.com/docs/editor/variables-reference
设置
- 方法1 : 作用域 : 一个会话中
"configurations": [
{ // 这是一个lauch 会话
"variables": {
"programPath": "${workspaceFolder}/build/bin/as",
//"testPath" : "~/work/work_le/test",
// "vsPath" : "~/work/work_le/vscode_scripts",
// "tcPath" : "~/work/work_le/tc_endian",
},
- 方法2 : 作用域 : 所有会话中
在 程序运行的 terminal 中 export testPath=~/work/work_le/test
// 此种情况 在 调试开始时会有警告,不过不存在问题.
引用
"args":
[
"-o","${testPath}/endian/main2.o",
],