향상된 색상 지정
Visual Studio Code C/C++ 확장이 IntelliSense가 활성화된 경우 의미론적 색상 지정을 지원합니다. 향상된 색상 지정의 사용은 C_Cpp.enhancedColorization 설정을 통해 제어됩니다. 이 설정은 기본적으로 활성화되어 있습니다.
"C_Cpp.enhancedColorization": "enabled"
테마
색상은 VS Code에서 테마 및 색상 사용자 지정을 위한 기존 지원을 사용하여 연결할 수 있습니다. 자세한 내용은 VS Code 테마 설명서를 참조하십시오.
색상은 의미론적 토큰 및 TextMate 범위와 연결됩니다.
C/C++ 테마 확장
Visual Studio의 기본 Light 및 Dark 테마와 유사한 VS Code 테마 세트를 만들었으며 의미론적 토큰에 대한 색상이 포함되어 있습니다. 이 테마는 여기에서 찾을 수 있습니다.
IntelliSense 토큰 및 범위
| 토큰 | 의미론적 토큰 이름 | 대체 TextMate 범위 |
|---|---|---|
| 클래스 템플릿 | templateType | entity.name.type.class.templated |
| 열거형 | enumMember | variable.other.enummember |
| 이벤트(C++/CLI) | 이벤트 | variable.other.event |
| 함수 | function | entity.name.function |
| 함수 템플릿 | templateFunction | entity.name.function.templated |
| 제네릭 형식(C++/CLI) | genericType | entity.name.type.class.generic |
| 전역 변수 | variable.global | variable.other.global |
| 레이블 | label | entity.name.label |
| 지역 변수 | variable.local | variable.other.local |
| 매크로 | macro | entity.name.function.preprocessor |
| 멤버 필드 | 속성 | variable.other.property |
| 멤버 함수 | method | entity.name.function.member |
| 네임스페이스 | namespace | entity.name.namespace |
| New / Delete | newOperator | keyword.operator.new |
| 연산자 오버로드 함수 | operatorOverload | entity.name.function.operator |
| 연산자 오버로드 멤버 | memberOperatorOverload | entity.name.function.operator.member |
| Parameter | 매개변수 | variable.parameter |
| 속성(C++/CLI) | cliProperty | variable.other.property.cli |
| 참조 형식(C++/CLI) | referenceType | entity.name.type.class.reference |
| 정적 멤버 필드 | property.static | variable.other.property.static |
| 정적 멤버 함수 | method.static | entity.name.function.member.static |
| 유형 | 타입 | entity.name.type |
| 사용자 정의 리터럴 - 숫자 | numberLiteral | entity.name.operator.custom-literal.number |
| 사용자 정의 리터럴 - 원시 | customLiteral | entity.name.operator.custom-literal |
| 사용자 정의 리터럴 - 문자열 | stringLiteral | entity.name.operator.custom-literal.string |
| 값 형식(C++/CLI) | valueType | entity.name.type.class.value |
설정에서 색상 사용자 지정
색상은 설정에서 전역적으로 재정의할 수도 있습니다.
"editor.semanticTokenColorCustomizations": {
"rules": {
"templateType": {
"foreground": "#ff0000",
"fontStyle": "italic bold underline"
}
}
}
또는 테마별로 재정의할 수 있습니다.
"editor.semanticTokenColorCustomizations": {
"[Visual Studio Dark]": {
"rules": {
"templateType": {
"foreground": "#ff0000",
"fontStyle": "italic bold underline"
}
}
}
}