Visual Studio Code
I ran two tests with Visual Studio Code: the first with the makefiles from embedXcode, the second with the preview of the Arduino extension Microsoft is working on.
Three extensions are required:
The Visual studio Code website provides all the required documentation for configuring Visual Studio Code. |
Visual Studio Code and three extensions:
C/C++, C/C++ Snippets, Native Debug |
Visual Studio Code sports a new logo, and localisations are now provided by a dedicated Language Pack extension.
Three new extensions:
|
Visual Studio Code updated logo with language pack and new extensions: IntelliCode, Cortex Debug, Shortcut Menu Bar and Language Pack
|
Using make and the makefiles
The first test uses the makefiles I've been developing for embedXcode since 2010.
I was surprised by the very limited customisation I had to perform to support each of all those three operating systems, namely Linux Mint 18.1, macOS 10.12.4 and Windows 10. |
I targeted the LaunchPad TivaC, with a built-in hardware debugger, and the Arduino M0 Pro, one of the few Arduino boards to feature a debugger.
Building and linking, uploading and running were completed successfully against both boards. Debugging relies on OpenOCD, thanks to the Native Debug extension by webfreak. Standard breakpoint, conditional breakpoint (pictured), watchpoints, call stack, everything ran smoothly as well. |
Toolbar, sort of
The Shortcut Menu Bar by Jerrygoyal brings a much awaited solution for a toolbar. It brings buttons to display the change window, change the active tab, beautify the code, list the files and open the terminal.
Two more buttons are added when the Arduino extension is installed: the Upload and Verify buttons. From top to bottom: the standard Visual Studio Code toolbar; the Shortcut Menu Bar with the Arduino extension; the Shortcut Menu Bar without the Arduino extension. |
Added buttons include Upload and Verify for Arduino,
change active tab, beautify the code, list the files, open terminal |
Debugging
The Cortex Debug extension by marus25, actually based on the Native Debug extension by webfreak, makes debugging against Cortex-M much easier. It displays breakpoints, conditional breakpoint, variables, stack, registers, and supports J-Link, OpenOCD, PyOCD, STlink, Black Magic Probe.
Only three key parameters are needed:
On macOS, Visual Studio Code may complain arm-none-eabi-gdb isn't signed and block its execution. Just go through the code-signing procedure for arm-none-eabi-gdb. |
Using the Arduino Extension
Please refer to the Arduino extension for Visual Studio Code page.
The biggest draw-back of the Arduino extension comes from the limitation of the extension, a mere front-end relying on the slow and non-standard Arduino proprietary build manager. |
Conclusion
I've especially enjoyed those features:
Contrary to Atom, Visual Studio Code brings more features in standard, like debugging, and recommended extensions, like C/C++. The implementation with the makefiles from embedXcode is a clear winner over the Arduino extension. Development is going fast, with one release a month. The team can be reached at this Gitter room. |
In 2018
Microsoft has just release the 2018 roadmap and I'm somehow disappointed.
It looks like Microsoft has its own agenda, somehow disconnected from users' needs, as C / C++ may not have the hype or Python, Node, JavaScript, or TypeScript. Better integration with make (i.e. by passing parameters on to, actually a show-stopper for me), better GUI options and documentation integration (e.g. with Doxygen) are low in priority, turning Visual Studio Code into a walled-garden. Visual Studio Code was high on my recommendations, but those missing features —especially the integration with make— and the lack of them in a foreseeable future made me revised my opinion and demote Visual Studio Code. Even with the new set of extensions, the roadmap for Visual Studio Code isn't clear for me. Microsoft seems to be over-reliant on the community for bringing improvements to the GUI and the integration with external tools, and doesn't realise the true potential of Visual Studio Code. |
In 2021
Compared to the initial assessment in 2017, Visual Studio Code has now reached a level a maturity that makes it a highly recommended solution.
All the issues mentionned earlier have been addressed, some natively, other through extensions: integration with make, debugging, support of Doxygen, tool bar, as well as the Arduino extension. New notable features include remote development, for example against a container on the same PC or against a remote Linux single board computer like a Raspberry Pi. |
Pros
|
Cons
|
Wrap-Up
|
Links
|
Posted 17 April 2017
Updated 16 June 2017, 20 Dec 2017, 18 Aug 2019, 03 Jan 2022