News

VS Code C++ Tool Customizes IntelliSense for Target Platforms

Visual Studio Code developers using Microsoft's C/C++ extension have gained the ability to customize the way IntelliSense works when coding for different platforms.

The C/C++ extension in the Visual Studio Code Marketplace adds language support for C++ to the cross-platform editor, including features such as debugging and IntelliSense, the latter providing individual language "smarts" like code completion.

Microsoft this week announced an update that addressed GitHub issue #1083 posted September 2017 titled "Support cross-compilation configurations for IntelliSense," that reads "I am sometimes working on my project using a cross-compilation toolchain (for example, working on a Mac laptop; the project targets Linux). I tried to configure IntelliSense to only search the project and the cross-compilation sysroot" only to get an error.

And, in announcing an update to the tool this week, Microsoft used that very same sample scenario:

"Let's say you're developing on macOS and your project targets Linux. Assuming you have a compiler compatible with your project's target platform and architecture, the C++ extension will query that compiler using the Compiler path, Compiler arguments, and IntelliSense mode settings in your IntelliSense configuration."

IntelliSense Mode
[Click on image for larger view.] IntelliSense Mode (source: Microsoft).

In other words, instead of using hard-coding system defines based on a host OS, the tool now uses the system defines returned by the compiler, Microsoft explained, providing the example that the intelliSenseMode value "linux-gcc-x64" could be used on a Mac host machine. "Now when you open your project in VS Code, you'll get IntelliSense for your target platform instead of macOS. No more squiggles from hardcoded system defines!"

Developers using a custom configuration provider such as CMake Tools or compile_commands.json don't need to update the C++ extension's IntelliSense configuration to get the provided functionality, however.

The update also squashes some 60-plus bugs and introduces some relatively minor new features, of which Microsoft highlighted the following:

  • clang-format has been updated to version 11. #6326
  • We now ship a native ARM64 clang-format binary with the extension for ARM64 Windows devices (#6494).
  • We added a command to generate EditorConfig contents from your code formatting settings (vcFormat) #6018
  • We support a new “console” launch config property for cppvsdbg (replacing the legacy “externalConsole” property). PR #6794

Much more detail about all of the above and many other changes is available in the release notes for the update, officially version 1.2.0.

About the Author

David Ramel is an editor and writer at Converge 360.

comments powered by Disqus

Featured

  • IDE Irony: Coding Errors Cause 'Critical' Vulnerability in Visual Studio

    In a larger-than-normal Patch Tuesday, Microsoft warned of a "critical" vulnerability in Visual Studio that should be fixed immediately if automatic patching isn't enabled, ironically caused by coding errors.

  • Building Blazor Applications

    A trio of Blazor experts will conduct a full-day workshop for devs to learn everything about the tech a a March developer conference in Las Vegas keynoted by Microsoft execs and featuring many Microsoft devs.

  • Gradient Boosting Regression Using C#

    Dr. James McCaffrey from Microsoft Research presents a complete end-to-end demonstration of the gradient boosting regression technique, where the goal is to predict a single numeric value. Compared to existing library implementations of gradient boosting regression, a from-scratch implementation allows much easier customization and integration with other .NET systems.

  • Microsoft Execs to Tackle AI and Cloud in Dev Conference Keynotes

    AI unsurprisingly is all over keynotes that Microsoft execs will helm to kick off the Visual Studio Live! developer conference in Las Vegas, March 10-14, which the company described as "a must-attend event."

  • Copilot Agentic AI Dev Environment Opens Up to All

    Microsoft removed waitlist restrictions for some of its most advanced GenAI tech, Copilot Workspace, recently made available as a technical preview.

Subscribe on YouTube