Semantic Coloring Settings for VHDL
Semantic coloring lets you enhance the readability of your VHDL code by applying custom colors and styles to different language constructs. This guide explains how to configure the custom VHDL semantic tokens in your VS Code settings.
Example Setting
Below is an example of a semantic coloring configuration for VHDL.
{
"editor.semanticTokenColorCustomizations": {
"rules": {
"sigasiPort": "#3f9acc",
"sigasiConditionalProcessingVariable": "#457dab",
"sigasiSignal": "#4FC1FF",
"sigasiSubprogramParameterVariable": "#9CDCFE",
"sigasiSubprogramParameterSignal": "#4FC1FF",
"sigasiSubprogramParameterConstant": "#E5C07B",
"sigasiConstant": "#E5C07B",
"sigasiAttribute": "#eacd95",
"sigasiGenericConstant": {
"italic": true,
"foreground": "#E5C07B"
},
"sigasiGenericType": {
"italic": true,
"foreground": "#E5C07B"
},
"sigasiGenericSubprogram": {
"italic": true,
"foreground": "#DCDCAA"
}
}
}
}
Token Descriptions
The token keywords below are used to configure how a VHDL construct should be styled.
Token | Construct |
---|---|
sigasiPort | A VHDL port |
sigasiConditionalProcessingVariable | A VHDL conditional processing variable |
sigasiSignal | A VHDL signal |
sigasiSubprogramParameterVariable | A VHDL variable parameter of a task or function |
sigasiSubprogramParameterSignal | A VHDL signal parameter of a task or function |
sigasiSubprogramParameterConstant | A VHDL constant parameter of a task or function |
sigasiConstant | A VHDL constant or enumeration literal |
sigasiAttribute | A VHDL attribute |
sigasiGenericConstant | A VHDL generic constant value |
sigasiGenericType | A VHDL generic type declaration |
sigasiGenericSubprogram | A VHDL generic function or task |
Customizing Your Setup
Open VS Code Settings: Navigate to File > Preferences > Settings and search for
.editor.semanticTokenColorCustomizations Edit or Add Your Rules: Modify the existing rules or add new ones based on the semantic tokens. Use the provided example as a starting point.
Save Your Changes: Once you’ve made your customizations, save the settings file. The new semantic coloring will be applied to your VHDL code immediately.