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

  • Hands On: New VS Code Insiders Build Creates Web Page from Image in Seconds

    New Vision support with GitHub Copilot in the latest Visual Studio Code Insiders build takes a user-supplied mockup image and creates a web page from it in seconds, handling all the HTML and CSS.

  • Naive Bayes Regression Using C#

    Dr. James McCaffrey from Microsoft Research presents a complete end-to-end demonstration of the naive Bayes regression technique, where the goal is to predict a single numeric value. Compared to other machine learning regression techniques, naive Bayes regression is usually less accurate, but is simple, easy to implement and customize, works on both large and small datasets, is highly interpretable, and doesn't require tuning any hyperparameters.

  • VS Code Copilot Previews New GPT-4o AI Code Completion Model

    The 4o upgrade includes additional training on more than 275,000 high-quality public repositories in over 30 popular programming languages, said Microsoft-owned GitHub, which created the original "AI pair programmer" years ago.

  • Microsoft's Rust Embrace Continues with Azure SDK Beta

    "Rust's strong type system and ownership model help prevent common programming errors such as null pointer dereferencing and buffer overflows, leading to more secure and stable code."

  • Xcode IDE from Microsoft Archrival Apple Gets Copilot AI

    Just after expanding the reach of its Copilot AI coding assistant to the open-source Eclipse IDE, Microsoft showcased how it's going even further, providing details about a preview version for the Xcode IDE from archrival Apple.

Subscribe on YouTube

Upcoming Training Events