visual-studio-code - VS code 多个格式化插件问题(用户设置)
问题描述
我无法理解为什么我无法在 VSCode 中指定用于格式化 Json 的扩展名。它给出了一个错误:“code-runner.executorMap”的“Expected comma jsonc(514)”:{“。我有多个 Json 插件,我试图通过单击它来配置其中一个插件,但它说用户设置存在问题。谢谢!
"workbench.colorTheme": "Default Light+",
"editor.suggestSelection": "first",
"vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",
"output.smartScroll.enabled": false,
"terminal.integrated.shell.windows": "C:\\WINDOWS\\System32\\cmd.exe",
"C_Cpp.updateChannel": "Insiders",
"c-cpp-flylint.flexelint.enable": false,
"window.zoomLevel": 0,
"java.configuration.checkProjectSettingsExclusions": false,
"workbench.iconTheme": "vscode-icons",
"code-runner.runInTerminal": true
"code-runner.executorMap": {
"javascript": "node",
"java": "cd $dir && javac $fileName && java $fileNameWithoutExt",
"c": "cd $dir && gcc $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt",
"cpp": "cd $dir && g++ $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt",
"objective-c": "cd $dir && gcc -framework Cocoa $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt",
"php": "php",
"python": "python -u",
"perl": "perl",
"perl6": "perl6",
"ruby": "ruby",
"go": "go run",
"lua": "lua",
"groovy": "groovy",
"powershell": "powershell -ExecutionPolicy ByPass -File",
"bat": "cmd /c",
"shellscript": "bash",
"fsharp": "fsi",
"csharp": "cd $dir && dotnet run $fileName",
"vbscript": "cscript //Nologo",
"typescript": "ts-node",
"coffeescript": "coffee",
"scala": "scala",
"swift": "swift",
"julia": "julia",
"crystal": "crystal",
"ocaml": "ocaml",
"r": "Rscript",
"applescript": "osascript",
"clojure": "lein exec",
"haxe": "haxe --cwd $dirWithoutTrailingSlash --run $fileNameWithoutExt",
"rust": "cd $dir && rustc $fileName && $dir$fileNameWithoutExt",
"racket": "racket",
"scheme": "csi -script",
"ahk": "autohotkey",
"autoit": "autoit3",
"dart": "dart",
"pascal": "cd $dir && fpc $fileName && $dir$fileNameWithoutExt",
"d": "cd $dir && dmd $fileName && $dir$fileNameWithoutExt",
"haskell": "runhaskell",
"nim": "nim compile --verbosity:0 --hints:off --run",
"lisp": "sbcl --script",
"kit": "kitc --run",
"v": "v run",
"sass": "sass --style expanded",
"scss": "scss --style expanded",
"less": "cd $dir && lessc $fileName $fileNameWithoutExt.css",
"FortranFreeForm": "cd $dir && gfortran $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt",
"fortran-modern": "cd $dir && gfortran $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt",
"fortran_fixed-form": "cd $dir && gfortran $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt",
"fortran": "cd $dir && gfortran $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt"
}
}
解决方案
这条线
"code-runner.runInTerminal": true
最后需要一个逗号。一般来说,对于这种错误,请将您的代码复制并粘贴到在线 json linter 中,https://jsonlint.com
以便更好地了解问题所在。
推荐阅读
- python - 如何排除少数列并替换大数据中的负值?
- regex - python中单词列表中的单词tokeinizing?
- python - 如何使用数据中的键值检查条件并显示所有嵌套值(如果存在)
- .net - Docker项目在什么情况下重建?
- python - 我有 PyVirtualDisplay==0.2.5 包的问题,用于使用虚拟显示器(无头模式)运行测试
- java - 如何在 3D Libgdx 中旋转透视相机
- node.js - Firestore For Loop Batch.Set 仅创建最后一个值文档
- c# - CreatedAtRoute 与模板
- extjs - 禁用登录页面中的右键单击 extjs 不起作用
- php - Laravel 表单请求不更新可空字段