News

Semantic Colorization Heads What's New for C/C++ in Visual Studio Code

Semantic colorization was singled out by Microsoft for new functionality added to the July 2019 update of the C/C++ extension for Visual Studio Code.

The much-requested semantic colorization -- colorization of tokens even when they are out of context, thus providing colorization beyond that of syntax -- may not sound like a big deal, but it was fairly complicated to enact.

"We faced many challenges in creating support for semantic colorization for the C/C++ extension since there is no VS Code API for semantic source highlighting and no support for semantic colorization in the VS Code language server protocol," said the dev team's Tara Raj. "We also can’t access a theme’s colors programmatically, so this support was even more challenging to make possible.

"Luckily, we were able to devise a way to overcome these challenges by managing our own set of tokens and their ranges, using TextEditorDecorations, and directly parsing theme files and VS Code settings to determine which colors to apply. With that, we are excited to share semantic colorization support!"

A practical example of what semantic colorization means was provided, illustrating how a struct named "box" was color-highlighted in its definition and also when it's used in the main function.

Another highlight of the July update is improved configuration of IntelliSense via a new settings editor UI. "The interface is simple and clear, and thus makes IntelliSense configuration easier to understand," Raj said.

Finally, Raj detailed tweaking the default path for the IntelliSense cache that was introduced in the March update -- caching header information for faster IntelliSense -- and improved in response to developer feedback that it was caching too much data.

More information on the above and other changes in the July update to the C/C++ VS Code extension is available in the July 24 blog post and the GitHub release notes.

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