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

  • Mastering Blazor Authentication and Authorization

    At the Visual Studio Live! @ Microsoft HQ developer conference set for August, Rockford Lhotka will explain the ins and outs of authentication across Blazor Server, WebAssembly, and .NET MAUI Hybrid apps, and show how to use identity and claims to customize application behavior through fine-grained authorization.

  • Linear Support Vector Regression from Scratch Using C# with Evolutionary Training

    Dr. James McCaffrey from Microsoft Research presents a complete end-to-end demonstration of the linear support vector regression (linear SVR) technique, where the goal is to predict a single numeric value. A linear SVR model uses an unusual error/loss function and cannot be trained using standard simple techniques, and so evolutionary optimization training is used.

  • Low-Code Report Says AI Will Enhance, Not Replace DIY Dev Tools

    Along with replacing software developers and possibly killing humanity, advanced AI is seen by many as a death knell for the do-it-yourself, low-code/no-code tooling industry, but a new report belies that notion.

  • Vibe Coding with Latest Visual Studio Preview

    Microsoft's latest Visual Studio preview facilitates "vibe coding," where developers mainly use GitHub Copilot AI to do all the programming in accordance with spoken or typed instructions.

  • Steve Sanderson Previews AI App Dev: Small Models, Agents and a Blazor Voice Assistant

    Blazor creator Steve Sanderson presented a keynote at the recent NDC London 2025 conference where he previewed the future of .NET application development with smaller AI models and autonomous agents, along with showcasing a new Blazor voice assistant project demonstrating cutting-edge functionality.

Subscribe on YouTube