From a7e211e7df7c844d26f9a6f7ddc07df8d80fe0f3 Mon Sep 17 00:00:00 2001 From: greyes Date: Sun, 5 Nov 2023 12:22:32 +0100 Subject: [PATCH 1/2] Added code snippets and templates --- .vscode/templates.code-snippets | 205 ++++++++++++++++++++++++++++++++ 1 file changed, 205 insertions(+) create mode 100644 .vscode/templates.code-snippets diff --git a/.vscode/templates.code-snippets b/.vscode/templates.code-snippets new file mode 100644 index 00000000..2af9a728 --- /dev/null +++ b/.vscode/templates.code-snippets @@ -0,0 +1,205 @@ +{ + // Place your RadonUlzer workspace snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and + // description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope + // is left empty or omitted, the snippet gets applied to all languages. The prefix is what is + // used to trigger the snippet and the body will be expanded and inserted. Possible variables are: + // $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. + // Placeholders with the same ids are connected. + // Example: + // "Print to console": { + // "scope": "javascript,typescript", + // "prefix": "log", + // "body": [ + // "console.log('$1');", + // "$2" + // ], + // "description": "Log output to console" + // } + "Simple Comment": { + "prefix": "comment", + "scope": "c, cpp", + "body": [ + "/* ${1:Comment} */" + ], + "description": "Simple C-styled comment." + }, + "Doxygen In-Line Comment": { + "prefix": "doxy_inline", + "scope": "c, cpp", + "body": [ + "/**< ${1:Comment} */", + ], + "description": "Simple in-line Doxygen comment." + }, + "Doxygen Comment": { + "prefix": "doxy_comment", + "scope": "c, cpp", + "body": [ + "/** ${1:Comment} */", + "$0" + ], + "description": "Simple Doxygen comment." + }, + "Doxygen Block Comment/Description": { + "prefix": "doxy_block", + "scope": "c, cpp", + "body": [ + "/**", + " * ${1:description}", + " *", + " * ${2:parameters}", + " *", + " * ${3:returns}", + " */", + "$0" + ], + "description": "Doxygen comment/description block." + }, + "Template Header File": { + "prefix": "template_header", + "scope": "c, cpp", + "body": [ + "/* MIT License", + " *", + " * Copyright (c) $CURRENT_YEAR Andreas Merkle ", + " *", + " * Permission is hereby granted, free of charge, to any person obtaining a copy", + " * of this software and associated documentation files (the \"Software\"), to deal", + " * in the Software without restriction, including without limitation the rights", + " * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell", + " * copies of the Software, and to permit persons to whom the Software is", + " * furnished to do so, subject to the following conditions:", + " *", + " * The above copyright notice and this permission notice shall be included in all", + " * copies or substantial portions of the Software.", + " *", + " * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR", + " * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,", + " * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE", + " * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER", + " * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,", + " * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE", + " * SOFTWARE.", + " */", + "", + "/*******************************************************************************", + " DESCRIPTION", + "*******************************************************************************/", + "/**", + " * @brief ${1:Description}.", + " * @author ${2:Author}", + " *", + " * @addtogroup ${3:doxygen group}", + " *", + " * @{", + " */", + "#ifndef ${4:FILE_NAME}_H", + "#define ${4:FILE_NAME}_H", + "", + "/******************************************************************************", + " * Compile Switches", + " *****************************************************************************/", + "$0", + "/******************************************************************************", + " * Includes", + " *****************************************************************************/", + "", + "/******************************************************************************", + " * Macros", + " *****************************************************************************/", + "", + "/******************************************************************************", + " * Types and Classes", + " *****************************************************************************/", + "", + "/******************************************************************************", + " * Functions", + " *****************************************************************************/", + "", + "#endif /* ${4:FILE_NAME}_H */", + "/** @} */", + "" + ], + "description": "Template for a header file." + }, + "Template Source File": { + "prefix": "template_source", + "scope": "c, cpp", + "body": [ + "/* MIT License", + " *", + " * Copyright (c) $CURRENT_YEAR Andreas Merkle ", + " *", + " * Permission is hereby granted, free of charge, to any person obtaining a copy", + " * of this software and associated documentation files (the \"Software\"), to deal", + " * in the Software without restriction, including without limitation the rights", + " * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell", + " * copies of the Software, and to permit persons to whom the Software is", + " * furnished to do so, subject to the following conditions:", + " *", + " * The above copyright notice and this permission notice shall be included in all", + " * copies or substantial portions of the Software.", + " *", + " * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR", + " * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,", + " * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE", + " * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER", + " * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,", + " * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE", + " * SOFTWARE.", + " */", + "", + "/*******************************************************************************", + " DESCRIPTION", + "*******************************************************************************/", + "/**", + " * @brief ${1:Description}", + " * @author ${2:Author}", + " */", + "", + "/******************************************************************************", + " * Includes", + " *****************************************************************************/", + "", + "#include \"${3:File Name}.h\"", + "$0", + "/******************************************************************************", + " * Compiler Switches", + " *****************************************************************************/", + "", + "/******************************************************************************", + " * Macros", + " *****************************************************************************/", + "", + "/******************************************************************************", + " * Types and classes", + " *****************************************************************************/", + "", + "/******************************************************************************", + " * Prototypes", + " *****************************************************************************/", + "", + "/******************************************************************************", + " * Local Variables", + " *****************************************************************************/", + "", + "/******************************************************************************", + " * Protected Methods", + " *****************************************************************************/", + "", + "/******************************************************************************", + " * Private Methods", + " *****************************************************************************/", + "", + "/******************************************************************************", + " * External Functions", + " *****************************************************************************/", + "", + "/******************************************************************************", + " * Local Functions", + " *****************************************************************************/", + "" + ], + "description": "Template for a source file." + } +} \ No newline at end of file From 74e30897a141cb625e21d5183b7adf518eb392ea Mon Sep 17 00:00:00 2001 From: greyes Date: Sun, 5 Nov 2023 12:22:44 +0100 Subject: [PATCH 2/2] Enabled format-on-save --- RadonUlzer.code-workspace | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/RadonUlzer.code-workspace b/RadonUlzer.code-workspace index 9017da00..0d1b1deb 100644 --- a/RadonUlzer.code-workspace +++ b/RadonUlzer.code-workspace @@ -4,5 +4,7 @@ "path": "." } ], - "settings": {} + "settings": { + "editor.formatOnSave": true + } } \ No newline at end of file