重中之重:添加了可以自定义的C、C++配置文件

This commit is contained in:
flykhan 2023-03-26 17:53:38 +08:00
parent 631cc7e88b
commit d327228541
3 changed files with 162 additions and 33 deletions

39
.vscode/launch.json vendored
View File

@ -1,19 +1,32 @@
// https://github.com/Microsoft/vscode-cpptools/blob/master/launch.md
{
"version": "0.2.0",
"configurations": [
{
"name": "C++ Launch (GDB)",
"type": "cppdbg",
"request": "launch",
"targetArchitecture": "x86",
"program": "${workspaceRoot}\\${fileBasename}.exe",
"miDebuggerPath":"D:\\mingw64\\bin\\gdb.exe",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceRoot}",
"externalConsole": true,
"preLaunchTask": "g++"
"name": "(gdb) Launch", //
"type": "cppdbg", // cppdbgcpptoolscppdbg
"request": "launch", // launchattach
"program": "C:\\Windows\\system32\\cmd.exe", // (debug)
// "program": "${workspaceFolder}\\debug\\${fileBasenameNoExtension}.exe", // (debug)
// "program": "${fileDirname}\\${fileBasenameNoExtension}.exe", // (Windows'\\')
// "program": "${fileDirname}/${fileBasenameNoExtension}.exe", // (Linux'/')
"args": ["/C","${workspaceFolder}\\debug\\${fileBasenameNoExtension}.exe","&","pause"], //
// "args": [], //
"stopAtEntry": false, // truemain
"cwd": "${workspaceFolder}", // ${fileDirname}
"environment": [], //
"externalConsole": true, // true使cmdIDE1810falseVSC
// "externalConsole": false, // true使cmdIDE1810falseVSC
"internalConsoleOptions": "neverOpen", // neverOpengdb
"MIMode": "gdb", // gdblldblldb
"miDebuggerPath": "gdb.exe", // WindowsLinux
"setupCommands": [
{ // STLGoogle
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": false
}
]
],
"preLaunchTask": "Compile" // tasks.jsonlabel
}]
}

110
.vscode/settings.json vendored
View File

@ -1,7 +1,109 @@
{
"files.associations": {
"*.js": "javascript",
"iostream": "cpp"
"workbench.sideBar.location": "left",
"window.title": "${dirty}${activeEditorLong}${separator}${rootName}${separator}${appName}",
"editor.wordSeparators": "`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?·~!¥…()—【】、;:‘’“”,。《》? ",
"files.defaultLanguage": "c++", // ctrl+N
"editor.formatOnType": false, // C/C++
"editor.suggest.snippetsPreventQuickSuggestions": true, // clangdsnippetsIntellisense
"editor.acceptSuggestionOnEnter": "off", // tabIntellisense
"editor.snippetSuggestions": "inline", // snippetsinline
"C_Cpp.clang_format_sortIncludes": true, // include
"C_Cpp.autocomplete": "default", // cpptoolsclangd
"C_Cpp.suggestSnippets": true, //
"editor.fontFamily": "JetBrains Mono",
"editor.fontSize": 17, //
"editor.fontLigatures": true, // https://typeof.net/Iosevka
"editor.minimap.enabled": false, // minimap西
"editor.dragAndDrop": false, //
"editor.cursorSmoothCaretAnimation": "on", //
"editor.smoothScrolling": false, //
"files.trimTrailingWhitespace": true, //
"files.insertFinalNewline": true, // Linux
"files.autoGuessEncoding": true, // 6
"workbench.settings.useSplitJSON": false, //
"window.zoomLevel": 0, //
"git.enabled": true, // git
"git.ignoreMissingGitWarning": true, //
"[c]": {
"files.encoding": "utf8" // gbkcpp
},
"C_Cpp.errorSquiggles": "disabled"
"[c++]": {
"files.encoding": "utf8" // gbkcpp
},
"files.associations": {
"iostream": "cpp",
"algorithm": "cpp",
"*.tcc": "cpp",
"random": "cpp",
"fstream": "cpp",
"istream": "cpp",
"ostream": "cpp",
"regex": "cpp",
"utility": "cpp",
"array": "cpp",
"atomic": "cpp",
"bitset": "cpp",
"cctype": "cpp",
"cfenv": "cpp",
"charconv": "cpp",
"chrono": "cpp",
"cinttypes": "cpp",
"clocale": "cpp",
"cmath": "cpp",
"codecvt": "cpp",
"complex": "cpp",
"condition_variable": "cpp",
"csetjmp": "cpp",
"csignal": "cpp",
"cstdarg": "cpp",
"cstddef": "cpp",
"cstdint": "cpp",
"cstdio": "cpp",
"cstdlib": "cpp",
"cstring": "cpp",
"ctime": "cpp",
"cuchar": "cpp",
"cwchar": "cpp",
"cwctype": "cpp",
"deque": "cpp",
"forward_list": "cpp",
"list": "cpp",
"unordered_map": "cpp",
"unordered_set": "cpp",
"vector": "cpp",
"exception": "cpp",
"functional": "cpp",
"iterator": "cpp",
"map": "cpp",
"memory": "cpp",
"memory_resource": "cpp",
"numeric": "cpp",
"optional": "cpp",
"ratio": "cpp",
"set": "cpp",
"string": "cpp",
"string_view": "cpp",
"system_error": "cpp",
"tuple": "cpp",
"type_traits": "cpp",
"future": "cpp",
"initializer_list": "cpp",
"iomanip": "cpp",
"iosfwd": "cpp",
"limits": "cpp",
"mutex": "cpp",
"new": "cpp",
"scoped_allocator": "cpp",
"shared_mutex": "cpp",
"sstream": "cpp",
"stdexcept": "cpp",
"streambuf": "cpp",
"thread": "cpp",
"typeindex": "cpp",
"typeinfo": "cpp",
"valarray": "cpp",
"queue": "cpp"
},
"C_Cpp.errorSquiggles": "Enabled",
}

42
.vscode/tasks.json vendored
View File

@ -1,17 +1,31 @@
// https://code.visualstudio.com/docs/editor/tasks
{
"version": "2.0.0",
"command": "g++",
"args": ["-g","-std=c++11","${file}","-o","${workspaceRoot}\\${fileBasename}.exe"],
"problemMatcher": {
"owner": "cpp",
"fileLocation": ["relative", "${workspaceRoot}"],
"pattern": {
"regexp": "^(.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$",
"file": 1,
"line": 2,
"column": 3,
"severity": 4,
"message": 5
}
}
"tasks": [{
"label": "Compile", // launch.jsonpreLaunchTask
"command": "g++", // 使C++g++
"args": [
"${file}",
"-o", // a.exeLinuxa.out
// "${fileDirname}/${fileBasenameNoExtension}.exe",
"${workspaceFolder}\\debug\\${fileBasenameNoExtension}.exe", // debug
"-g", //
"-Wall", //
"-static-libgcc", // libgcc
"-fexec-charset=utf-8", // 使GBKWin
// "-std=c11", // C++c++17
], // VSC西
"type": "process", // processvsccommandshellshellargsshell
"group": {
"kind": "build",
"isDefault": true // truectrl shift B
},
"presentation": {
"echo": true,
"reveal": "always", // alwayssilentneverVSC
"focus": false, // true使taskC/C++true
"panel": "shared" //
},
"problemMatcher":"$gcc" // Lint
}]
}