vscode插件
位于:C:\Users\用户名\AppData\Roaming\Code\User\settings.json
settings.json
{// "C_Cpp.intelliSenseEngine": "default",//智能查找默认值"C_Cpp.intelliSenseEngineFallback": "enabled", //需要添加的 or "Disabled""C_Cpp.intelliSenseEngine": "Tag Parser", // 需要添加的"C_Cpp_Runner.cCompilerPath": "gcc","C_Cpp_Runner.cppCompilerPath": "g++","C_Cpp_Runner.debuggerPath": "gdb","C_Cpp_Runner.cStandard": "","C_Cpp_Runner.cppStandard": "","C_Cpp_Runner.msvcBatchPath": "C:/Program Files/Microsoft Visual Studio/VR_NR/Community/VC/Auxiliary/Build/vcvarsall.bat","C_Cpp_Runner.useMsvc": false,"C_Cpp_Runner.warnings": ["-Wall","-Wextra","-Wpedantic","-Wshadow","-Wformat=2","-Wcast-align","-Wconversion","-Wsign-conversion","-Wnull-dereference"],"C_Cpp_Runner.msvcWarnings": ["/W4","/permissive-","/w14242","/w14287","/w14296","/w14311","/w14826","/w44062","/w44242","/w14905","/w14906","/w14263","/w44265","/w14928"],"C_Cpp_Runner.enableWarnings": true,"C_Cpp_Runner.warningsAsError": false,"C_Cpp_Runner.compilerArgs": [],"C_Cpp_Runner.linkerArgs": [],"C_Cpp_Runner.includePaths": [],"C_Cpp_Runner.includeSearch": ["*", "**/*"],"C_Cpp_Runner.excludeSearch": ["**/build","**/build/**","**/.*","**/.*/**","**/.vscode","**/.vscode/**"],"C_Cpp_Runner.useAddressSanitizer": false,"C_Cpp_Runner.useUndefinedSanitizer": false,"C_Cpp_Runner.useLeakSanitizer": false,"C_Cpp_Runner.showCompilationTime": false,"C_Cpp_Runner.useLinkTimeOptimization": false,"C_Cpp_Runner.msvcSecureNoWarnings": false,"files.associations": {"vector": "cpp","atomic": "cpp","*.tcc": "cpp","cstddef": "cpp","cstdint": "cpp","exception": "cpp","algorithm": "cpp","memory": "cpp","memory_resource": "cpp","type_traits": "cpp","utility": "cpp","initializer_list": "cpp","iosfwd": "cpp","new": "cpp","typeinfo": "cpp","iostream": "cpp","ostream": "cpp"},"terminal.integrated.profiles.windows": {"PowerShell": {"source": "PowerShell","icon": "terminal-powershell","args": ["-NoLogo", "-NoExit", "-Command", "chcp.com 65001"]},"Command Prompt": {"path": ["${env:windir}\\Sysnative\\cmd.exe","${env:windir}\\System32\\cmd.exe"],"args": ["/K", "chcp 65001"],"icon": "terminal-cmd"}},"[python]": {"editor.formatOnType": true},"code-runner.executorMap": {"javascript": "node","java": "cd $dir && javac $fileName && java $fileNameWithoutExt","c": "cd $dir && gcc $fileName -o $workspaceRoot\\build\\$fileNameWithoutExt && $workspaceRoot\\build\\$fileNameWithoutExt","zig": "zig run","cpp": "cd $dir && g++ $fileName -o $workspaceRoot\\build\\$fileNameWithoutExt && $workspaceRoot\\build\\$fileNameWithoutExt","objective-c": "cd $dir && gcc -framework Cocoa $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt","php": "php","python": "set PYTHONIOENCODING=utf8 && 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": "scriptcs","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": "runghc","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","sml": "cd $dir && sml $fileName"},"security.workspace.trust.untrustedFiles": "open","liveServer.settings.donotShowInfoMsg": true,"[html]": {"editor.defaultFormatter": "esbenp.prettier-vscode"},"workbench.startupEditor": "none","workbench.colorTheme": "Visual Studio Dark","files.autoSave": "afterDelay","git.openRepositoryInParentFolders": "never","git.autofetch": true,"[javascript]": {"editor.defaultFormatter": "esbenp.prettier-vscode"},"[java]": {"editor.defaultFormatter": "redhat.java"},"editor.inlineSuggest.showToolbar": "always","editor.codeActionsOnSave": {//"source.organizeImports": "explicit", //自动导包并且包会自动排序、移除无用的包名},"editor.formatOnPaste": true, // 粘贴代码时格式化"editor.formatOnSave": true, // 在保存时对代码格式化"java.compile.nullAnalysis.mode": "automatic","java.import.projectSelection": "manual","java.showBuildStatusOnStart.enabled": "notification","java.saveActions.organizeImports": true,"java.project.sourcePaths": ["src"],"java.project.referencedLibraries": ["e:\\AndroidProjects\\MTK_9633_CtvMiddleWareJar\\*.jar"//"e:\\AndroidProjects\\MTK_9256_CtvMiddleWareJar\\*.jar"],"java.templates.typeComment": ["/**"," * @author H."," * @date ${date} ${time}"," */"],"jdk.jdkhome": "D:\\Program Files\\Java\\jdk18","jdk.project.jdkhome": "D:\\Program Files\\Java\\jdk18","java.configuration.updateBuildConfiguration": "automatic","code-runner.runInTerminal": true,"[kotlin]": {"editor.formatOnSave": true,"editor.defaultFormatter": "fwcd.kotlin"},"kotlin.debugAdapter.enabled": false,"kotlin.diagnostics.enabled": false,"kotlin.java.home": "D:\\Program Files\\Java\\jdk18","[jsonc]": {"editor.defaultFormatter": "esbenp.prettier-vscode"}
}
c_cpp_properties.json
{"configurations": [{"name": "Win32","includePath": ["${workspaceFolder}/**"],"defines": ["_DEBUG", "UNICODE", "_UNICODE"],"compilerPath": "C:\\mingw64\\bin\\gcc.exe","cStandard": "c17","cppStandard": "c++17","intelliSenseMode": "windows-gcc-x64"}],"version": 4
}
launch.json
{"version": "0.2.0","configurations": [{"name": "(gdb) Launch", // 配置名称,将会在启动配置的下拉菜单中显示"type": "cppdbg", // 配置类型,这里只能为cppdbg"request": "launch", // 请求配置类型,可以为launch(启动)或attach(附加)"program": "${workspaceFolder}\\build\\${fileBasenameNoExtension}.exe", // 将要进行调试的程序的路径"args": [], // 程序调试时传递给程序的命令行参数,一般设为空即可"stopAtEntry": false, // 设为true时程序将暂停在程序入口处,一般设置为false"cwd": "${workspaceFolder}", // 调试程序时的工作目录,一般为${workspaceFolder}即代码所在目录"environment": [],"externalConsole": false, // 调试时是否显示控制台窗口,一般设置为true显示控制台"MIMode": "gdb","miDebuggerPath": "C:\\mingw64\\bin\\gdb.exe", // miDebugger的路径,注意这里要与MinGw的路径对应"preLaunchTask": "g++.exe build active file", // 调试会话开始前执行的任务,一般为编译程序,c++为g++, c为gcc"setupCommands": [{"description": "Enable pretty-printing for gdb","text": "-enable-pretty-printing","ignoreFailures": true}]}]
}
tasks.json
{"version": "2.0.0","tasks": [{"type": "cppbuild","label": "g++.exe build active file","command": "C:\\mingw64\\bin\\g++.exe","args": ["-fexec-charset=GBK","-fdiagnostics-color=always","-g","${file}","-o","${workspaceFolder}\\build\\${fileBasenameNoExtension}.exe"],"options": {"cwd": "${workspaceFolder}"},"problemMatcher": ["$gcc"],"group": "build","detail": "编译器: C:\\mingw64\\bin\\g++.exe"},{"type": "cppbuild","label": "C/C++: g++.exe 生成活动文件","command": "C:\\mingw64\\bin\\g++.exe","args": ["-fdiagnostics-color=always","-g","${file}","-o","${fileDirname}\\build\\${fileBasenameNoExtension}.exe"],"options": {"cwd": "${fileDirname}"},"problemMatcher": ["$gcc"],"group": {"kind": "build","isDefault": true},"detail": "调试器生成的任务。"}]
}