Wayback Machine
56 captures
29 Jul 2019 - 30 Dec 2025
Mar APR May
16
2019 2020 2021
success
fail
About this capture
COLLECTED BY
Collection: Outlinks From Tweets
TIMESTAMPS
loading
The Wayback Machine - https://web.archive.org/web/20200416225840/https://code.visualstudio.com/docs/cpp/colorization-cpp
This site uses cookies for analytics, personalized content and ads. By continuing to browse this site, you agree to this use. Learn more
Skip to content 
Visual Studio Code
  • Docs
  • Updates
  • Blog
  • API
  • Extensions
  • FAQ
  • Search
  • Search Search
  • Download VS Code Download VS Code Download

Version 1.44 is now available! Read about the new features and fixes from March.

Dismiss this update
'; document.body.appendChild(div.children[0]); }
  • Overview
  • Setup
    • Overview
    • Linux
    • macOS
    • Windows
    • Network
    • Additional Components
  • Get Started
    • Intro Videos
    • Tips and Tricks
    • User Interface
    • Themes
    • Settings
    • Key Bindings
    • Display Language
    • Telemetry
  • User Guide
    • Basic Editing
    • Extension Marketplace
    • IntelliSense
    • Code Navigation
    • Refactoring
    • Debugging
    • Version Control
    • Integrated Terminal
    • Tasks
    • Settings Sync
    • Snippets
    • Emmet
    • Command Line
    • Multi-root Workspaces
    • Accessibility
  • Languages
    • Overview
    • JavaScript
    • JSON
    • HTML
    • CSS, SCSS and Less
    • TypeScript
    • Markdown
    • PowerShell
    • C++
    • Java
    • PHP
    • Python
    • Go
    • T-SQL
    • C#
    • .NET Core
  • Node.js / JavaScript
    • Working with JavaScript
    • Node.js Tutorial
    • Node.js Debugging
    • Node.js Deployment
    • React Tutorial
    • Angular Tutorial
    • Vue Tutorial
    • Ember Tutorial
    • Debugging Recipes
    • Extensions
  • TypeScript
    • Tutorial
    • Compiling
    • Debugging
  • Python
    • Tutorial
    • Editing Code
    • Linting
    • Debugging
    • Environments
    • Testing
    • Jupyter Notebook Support
    • Python Interactive
    • Data Science Tutorial
    • Django Tutorial
    • Flask Tutorial
    • Create containers
    • Python on Azure
    • Settings Reference
  • Java
    • Getting Started
    • Navigate and Edit
    • Refactoring
    • Linting
    • Project Management
    • Build Tools
    • Run and Debug
    • Testing
    • Spring Boot
    • Application Servers
    • Java on Azure
    • Extensions
    • FAQ
  • C++
    • GCC on Windows
    • Microsoft C++
    • GCC on Linux
    • GCC on Windows Subsystem for Linux
    • Clang on macOS
    • Debugging
    • Editing
    • Settings
    • Enhanced colorization
    • c_cpp_properties.json
    • Debug configuration
    • Natvis framework
    • Pipe transport
    • Logging
    • FAQ
  • Containers
    • Overview
    • Node.js
    • Python
    • ASP.NET Core
    • Debug
    • Registries
    • Deploy to Azure
    • Choose a dev environment
    • Customize
  • Azure
    • Extensions
    • Deployment
    • Remote Debugging for Node.js
    • Docker
    • MongoDB
    • Kubernetes
    • Try Azure App Service
  • Remote
    • Overview
    • SSH
    • Containers
    • Visual Studio Online
    • Windows Subsystem for Linux
    • Tutorials
    • Tips and Tricks
    • Advanced Containers
    • Linux Prerequisites
    • FAQ

Topics

Enhanced colorization

The Visual Studio Code C/C++ extension now supports semantic colorization, when IntelliSense is enabled. Use of enhanced colorization is controlled by the C_Cpp.enhancedColorization setting. This setting is enabled by default.

"C_Cpp.enhancedColorization": "Enabled"

Themes

Colors can be associated using the existing support for theming and color customization in VS Code. See the VS Code Themes documentation for more information.

Colors are associated with TextMate scopes.

Many of the tokens recognized by IntelliSense do not directly map to existing scopes in VS Code's default C/C++ TextMate grammar, so are likely not colored by existing VS Code themes.

C/C++ Themes Extension

We've created a set of VS Code themes that closely resemble the default Light and Dark themes in Visual Studio, and include colors for semantic tokens. These themes can be found here.

IntelliSense Tokens and Scopes

Token Scope
Class Template entity.name.type.class.templated
Enumerator variable.other.enummember
Event (C++/CLI) variable.other.event
Function entity.name.function
Function Template entity.name.function.templated
Generic Type (C++/CLI) entity.name.type.class.generic
Global Variable variable.other.global
Label entity.name.label
Local Variable variable.other.local
Macro entity.name.function.preprocessor
Member Field variable.other.property
Member Function entity.name.function.member
Namespace entity.name.namespace
New / Delete keyword.operator.new
Operator Overload Function entity.name.function.operator
Operator Overload Member entity.name.function.operator.member
Parameter variable.parameter
Property (C++/CLI) variable.other.property.cli
Reference Type (C++/CLI) entity.name.type.class.reference
Static Member Field variable.other.property.static
Static Member Function entity.name.function.member.static
Type entity.name.type
User-Defined Literal - Number entity.name.operator.custom-literal.number
User-Defined Literal - Raw entity.name.operator.custom-literal
User-Defined Literal - String entity.name.operator.custom-literal.string
Value Type (C++/CLI) entity.name.type.class.value

Customizing Colors in Settings

Colors can also be overridden globally, in settings:

    "editor.tokenColorCustomizations": {
        "textMateRules": [
            {
                "scope": "entity.name.type",
                "settings": {
                    "foreground": "#FF0000",
                    "fontStyle": "italic bold underline"
                }
            }
        ]
    }

Or, overridden on a per-theme basis:

    "editor.tokenColorCustomizations": {
        "[Visual Studio Dark]": {
            "textMateRules": [
                {
                    "scope": "entity.name.type",
                    "settings": {
                        "foreground": "#FF0000",
                        "fontStyle": "italic bold underline"
                    }
                }
            ]
        }
    }
07/29/2019

In this article there are 3 sectionsIn this article

  • Themes
  • IntelliSense Tokens and Scopes
  • Customizing Colors in Settings
  • Hello from Seattle.
  • Follow @code
  • Support
  • Privacy
  • Terms of Use
  • License
Microsoft homepage Microsoft homepage © 2020 Microsoft