[英]VSC platform-specific settings
My settings.json
on Linux machine contains setting lines for cortex-debug
extension:我在 Linux 机器上的settings.json
包含cortex-debug
扩展的设置行:
"cortex-debug.armToolchainPath": "/opt/gcc-arm-none-eabi/bin/",
"cortex-debug.JLinkGDBServerPath": "/opt/SEGGER/JLink_V754b/JLinkGDBServerCLExe",
The same file on Windows machine should refer to a different file name JLinkGDBServerCL.exe
(yes, I understand such dumb naming is guilty of Segger, but...) Windows 机器上的同一个文件应该引用不同的文件名JLinkGDBServerCL.exe
(是的,我知道这种愚蠢的命名是JLinkGDBServerCL.exe
,但是......)
When settings sync turned on, I continuously get the wrong config on one (Windows or Linux) machine.当设置同步打开时,我在一台(Windows 或 Linux)机器上不断得到错误的配置。
Is it possible to set a platform-specific section in settings.json
to define a different key for an extension?是否可以在settings.json
中settings.json
特定于平台的部分来为扩展定义不同的键?
One way is to use VSCode's features to define machine specific settings or prevent certain settings from being synced,一种方法是使用 VSCode 的功能来定义特定于机器的设置或防止某些设置被同步,
https://code.visualstudio.com/docs/editor/settings-sync#_configuring-synced-data https://code.visualstudio.com/docs/editor/settings-sync#_configuring-synced-data
Ok, found another solution for my problem.好的,为我的问题找到了另一个解决方案。
At first, install platform-settings
from marketplace:首先,从市场安装platform-settings
:
https://marketplace.visualstudio.com/items?itemName=runarsf.platform-settings https://marketplace.visualstudio.com/items?itemName=runarsf.platform-settings
Next, move required settings to a new place:接下来,将所需设置移动到新位置:
"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"
}
}
But variant with sync prevention looks pretty good.但是带有同步预防的变体看起来很不错。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.