[英]VSC platform-specific settings
我在 Linux 机器上的settings.json
包含cortex-debug
扩展的设置行:
"cortex-debug.armToolchainPath": "/opt/gcc-arm-none-eabi/bin/",
"cortex-debug.JLinkGDBServerPath": "/opt/SEGGER/JLink_V754b/JLinkGDBServerCLExe",
Windows 机器上的同一个文件应该引用不同的文件名JLinkGDBServerCL.exe
(是的,我知道这种愚蠢的命名是JLinkGDBServerCL.exe
,但是......)
当设置同步打开时,我在一台(Windows 或 Linux)机器上不断得到错误的配置。
是否可以在settings.json
中settings.json
特定于平台的部分来为扩展定义不同的键?
一种方法是使用 VSCode 的功能来定义特定于机器的设置或防止某些设置被同步,
https://code.visualstudio.com/docs/editor/settings-sync#_configuring-synced-data
好的,为我的问题找到了另一个解决方案。
首先,从市场安装platform-settings
:
https://marketplace.visualstudio.com/items?itemName=runarsf.platform-settings
接下来,将所需设置移动到新位置:
"platformSettings.platforms": {
"win32": {
"cortex-debug.armToolchainPath": "C:/Program Files (x86)/GNUARM/bin/",
"cortex-debug.JLinkGDBServerPath": "JLinkGDBServerCL.Exe",
},
"linux": {
"cortex-debug.armToolchainPath": "/opt/gcc-arm-none-eabi/bin/",
"cortex-debug.JLinkGDBServerPath": "/opt/SEGGER/JLink_V754b/JLinkGDBServerCLExe"
}
}
但是带有同步预防的变体看起来很不错。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.