Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update UnrealEngine.gitignore #4500

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

wdhongtw
Copy link

@wdhongtw wdhongtw commented Sep 4, 2024

Unreal Engine supports project file generation for VSCode. Enhance Unreal ignore file for VSCode accordingly.

Reasons for making this change:

I'm an ordinary developer who is using Unreal Engine recently.

This PR makes sure that all files generated by Unreal Engine, which contains user/machine specific contents,
is ignored by this ignore template out of the box.

.vscode folder will contain a bunch of compile commands, which consist of machine specific paths.

For example, in .vscode\compileCommands_<ProjectName>.json, there will be

	{
		"file": "C:\\Users\\<username>\\Unreal Projects\\PlayUnreal\\Source\\PlayUnreal\\PlayUnreal.cpp",
		"arguments": [
			"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.38.33130\\bin\\Hostx64\\x64\\cl.exe",
			"@C:\\Users\\<username>\\Unreal Projects\\PlayUnreal\\.vscode\\compileCommands_PlayUnreal\\PlayUnreal.1.rsp"
		],
		"directory": "C:\\Program Files\\Epic Games\\UE_5.4\\Engine\\Source"
	}

Also, in <ProjectName>.code-workspace

			{
				"name": "Launch <ProjectName> (Shipping)",
				"request": "launch",
				"program": "C:\\Users\\<username>\\Unreal Projects\\<ProjectName>\\Binaries\\Win64\\UnrealGame-Win64-Shipping.exe",
				"preLaunchTask": "<ProjectName> Win64 Shipping Build",
				"args": [
				],
				"cwd": "C:\\Program Files\\Epic Games\\UE_5.4",
				"stopAtEntry": false,
				"console": "integratedTerminal",
				"type": "cppvsdbg",
				"visualizerFile": "C:\\Program Files\\Epic Games\\UE_5.4\\Engine\\Extras\\VisualStudioDebugging\\Unreal.natvis",
				"sourceFileMap": {
					"D:\\build\\++UE5\\Sync": "C:\\Program Files\\Epic Games\\UE_5.4"
				}
			}

If we create a new C++ project from latest version of Unreal Engine (5.4), .vscode is ignored
by the generated .gitignore file. (Although *.code-workspace is still not included.)

Links to documentation supporting these rule changes:

Unreal Engine supports project file generation for VSCode.
Enhance Unreal ignore file for VSCode accordingly.
@wdhongtw
Copy link
Author

wdhongtw commented Sep 5, 2024

As a reference, the following is the generated default .gitignore file
when creating a new Unreal Engine project throught Unreal Engine Editor (Unreal Engine Editor for Windows v5.4).

Binaries
DerivedDataCache
Intermediate
Saved
.vscode
.vs
*.VC.db
*.opensdf
*.opendb
*.sdf
*.sln
*.suo
*.xcodeproj
*.xcworkspace

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant