Skip to content

Instantly share code, notes, and snippets.

@bohdon
Created November 29, 2019 21:48
Show Gist options
  • Select an option

  • Save bohdon/9723782252c0e20bf899828b79996d2e to your computer and use it in GitHub Desktop.

Select an option

Save bohdon/9723782252c0e20bf899828b79996d2e to your computer and use it in GitHub Desktop.
UE4 snippets for Visual Studio Code
{
// Place your global 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"
// }
"New Class - AActor": {
"scope": "cpp",
"prefix": "class-actor",
"body": [
"#pragma once",
"",
"#include \"CoreMinimal.h\"",
"#include \"GameFramework/Actor.h\"",
"#include \"$TM_FILENAME_BASE.generated.h\"",
"",
"",
"UCLASS()",
"class ${1:${WORKSPACE_NAME/(.*)/${1:/upcase}/}}_API A${2:$TM_FILENAME_BASE} : public AActor",
"{",
" GENERATED_BODY()",
"",
"public:",
" A$2();",
"};",
"",
"#include \"$TM_FILENAME_BASE.h\"",
"",
"",
"A$2::A$2()",
"{",
"}"
],
"description": "Create a new AActor class"
},
"New Class - UObject": {
"scope": "cpp",
"prefix": "class-object",
"body": [
"#pragma once",
"",
"#include \"CoreMinimal.h\"",
"#include \"UObject/Object.h\"",
"#include \"$TM_FILENAME_BASE.generated.h\"",
"",
"",
"UCLASS()",
"class ${1:${WORKSPACE_NAME/(.*)/${1:/upcase}/}}_API U${2:$TM_FILENAME_BASE} : public UObject",
"{",
" GENERATED_BODY()",
"",
"public:",
" U$2();",
"};",
"",
"#include \"$TM_FILENAME_BASE.h\"",
"",
"",
"U$2::U$2()",
"{",
"}"
],
"description": "Create a new UObject class"
},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment