Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

audiomatt

macrumors member
Original poster
Dec 28, 2017
95
124
I'm mid C++ project in Xcode 10 and the syntax formatting is absolutely atrocious (and it looks as if it'll probably never be improved given the buzz).

I've noticed that the "build succeeded" is a headsup thing so I'm thinking, if I can rig a key command to make xcode build in the background, it might not be so bad to edit in VSCode.

Are there any tricks to rigging this? I really don't want to port all those build settings that I currently don't understand over to a different proprietary IDE.
 

jwhazel

macrumors regular
Sep 22, 2005
222
77
Are you aware of the Tasks in VSC? Basically just a simple JSON file in the .vscode directory of your project that can be used to define command line tasks. You can then use ⇧⌘B shortcut to run the tasks. I've set this up before for GCC/G++. Example:

HTML:
{
    "version": "2.0.0",
    "tasks": [
        {
            "label": "build my project",
            "type": "shell",
            "command": "g++ main.cpp",
            "group": {
                "kind": "build",
                "isDefault": true
            }
        }
    ]
}

I don't know of the top of my head what the command line is to build from Xcode, but I'm sure one exists.

More documentation on tasks: https://code.visualstudio.com/docs/editor/tasks#vscode
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.