解决在 VSCode 插件参数配置过程中出现的如下警告:
unable to write into user setings. Please open the user settings to correct errots/warnings in it and try again.
这里一般是 settings.json 文件中出现的格式或语法错误的问题。修改文件后,便可解决。
打开VS Code的配置文件settings.json
- 在VS Code环境中执行Ctrl+Shift+P; 2.选择 Open User Settings(JSON)。
举例如下:
{
"python.defaultInterpreterPath": "C:\\Users\\MindMotion\\AppData\\Local\\Programs\\Python\\Python310\\python.exe",
"security.workspace.trust.untrustedFiles": "open",
"files.autoSave": "afterDelay",
"files.trimTrailingWhitespace": true,
"files.trimFinalNewlines": true,
"workbench.startupEditor": "none",
"KeilAssistant.MDK.Uv4Path": "C:\\Keil_v5\\UV4\\UV4.exe",
"KeilAssistant.C51.Uv4Path": "C:\\Keil_v5\\UV4\\UV4.exe",
"editor.renderWhitespace": "all",
"editor.stickyScroll.enabled": true,
"workbench.colorTheme": "Visual Studio Dark",
"window.zoomLevel": 1,
"terminal.integrated.defaultProfile.windows": "mysys2-mingw64",
"terminal.integrated.profiles.windows": {
"mysys2-mingw64": {
"path": "cmd.exe",
"args": ["/c","C:\\msys64\\msys2_shell.cmd -defterm -mingw64 -no-start -here"]
}
}
仔细观察会发现,上述json
格式文件中缺少了一个}
符号,这里补全即可,补全后如下所示:
{
"python.defaultInterpreterPath": "C:\\Users\\MindMotion\\AppData\\Local\\Programs\\Python\\Python310\\python.exe",
"security.workspace.trust.untrustedFiles": "open",
"files.autoSave": "afterDelay",
"files.trimTrailingWhitespace": true,
"files.trimFinalNewlines": true,
"workbench.startupEditor": "none",
"KeilAssistant.MDK.Uv4Path": "C:\\Keil_v5\\UV4\\UV4.exe",
"KeilAssistant.C51.Uv4Path": "C:\\Keil_v5\\UV4\\UV4.exe",
"editor.renderWhitespace": "all",
"editor.stickyScroll.enabled": true,
"workbench.colorTheme": "Visual Studio Dark",
"window.zoomLevel": 1,
"terminal.integrated.defaultProfile.windows": "mysys2-mingw64",
"terminal.integrated.profiles.windows": {
"mysys2-mingw64": {
"path": "cmd.exe",
"args": ["/c","C:\\msys64\\msys2_shell.cmd -defterm -mingw64 -no-start -here"]
}
}
}
参考文献
【“Unable to write into user settings. Please open User Settings file to correct errors/warnings in it and try again.” #38731】https://github.com/Microsoft/vscode/issues/38731