I would like to use Visual Studio Code on Mac to write my game code.
VSCode offers a C++ extension to add auto-complete and other features to the editor. To achieve that, you have to actually add your include paths to a c_cpp_properties.json file with a structure like this:
I guess I’d have to add the engine’s headers path to configurations.includePath, but it looks like adding “/Users/Shared/Epic Games/UE_4.15/Engine/Source” isn’t of much use.
Has anyone else tried to achieve this and managed to get autocompletion and sources navigation to work?
Yes, I’m currently using VSCode together with the awesome YouCompleteMe extension. It’s not exactly simple to setup but once you get it running it’s awesome. BTW VS community edition is free. I’m stuck with VSCode because I’m working on macOS.
I tried getting YouCompleteMe to work with vim and UE4 but couldn’t get it working quite right. Would you be willing to share how you got it working and maybe what your config files look like
Be sure to configure the integrated shell to use cmd (under windows, of course ^^). ${workspaceRoot} and ${workspaceRootFolderName} are variables built in into vscode.
It will only work if you open your project folder directly under vscode, otherwise you can just put the absolute path.
I’ve added the config variable UE4_Root which points to the UE4 folder.
Just add “UE4_Root”: “C:/Unreal/UE_4.16/Engine” (with the correct path, of course) into your settings.json and you can use it with ${config:UE4_Root}.
You have 2 tasks defined here.
Building a Development Editor (Win64), and regenerating the visual studio project files.
This way I can manually add a .h into my project from vscode, regenerate it, and then build.
I tried adding a problem matcher, but it doesn’t seem to work tho…
I wanted to create a vscode plugin to try and ease-up the build process under vscode. But I may need some help to make it work under Linux/OSX too, if anyone is interested ^^
I’m interested too about the proper configuration for auto-completion. I can’t make a working YouCompleteMe configuration, and adding the folders manually gives me too much auto-completion (like methods from other classes…).
So, I’ve found that I had to change some things of your task.json file or I’ll just get a few errors when executing the task. Unsure why (I’m not much familiar with VSCode on Windows nor Windows dev).