Visual Studio Code Support
Welcome to the new Flax Facts! Today we will showcase one of the features in the latest Flax 0.7 version which is: full support for Visual Studio Code in Flax. This includes both C++ and C# scripting and deep integration with Editor.
After downloading and installing Visual Studio Code (from here) we recommend installing a set of extensions:
- C# –
- Mono Debug –
- C/C++ –
ms-vscode.cpptools(optional – useful if you code in C++)
The first one (ms-dotnettools.csharp) is useful if you write C# scripts. For C++ coding we recommend the last one (ms-vscode.cpptools). Also, if you want to debug C# code right in the Code get Mono extension (ms-vscode.mono-debug).
The last step is to open Flax Editor, go to Tools -> Options in the main menu to open editor options windows. Then select Source Code tab and set Source Code Editor to Visual Studio Code. If this option is missing, then ensure you have VSCode installed. Confirm with the Save button to apply changes. After that, you are ready to go!
After the setup, you can generate scripts project files in Editor. It will automatically create .vscode folder with all settings for tasks and code editing alongside .code-workspace file for your Code workspace.
Now, you can use generated tasks to start Editor with C++ scripts debugging like shown on an image below.
To debug C# scripts you can use dedicated launch tasks and after setting Mono debugger port or starting Flax with the predefined port you can attach to the running Flax instance (editor or a game). To learn more about it see the official documentation here.
Right now, we fully support Visual Studio and Visual Studio Code as code editors. Rider IDE can also be used to inspect and debug code if loading generated project files for VS. In the future, we plan to bring support for more code editing IDEs. Also, both Editor and Flax.Build are very extensible so making customizations or adding own integrations is rather easy.
Feel free to give VS Code a try as it’s very lightweight and powerful code editing environment. That’s all for today. Bye!