Semantic Coloring

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.

TokenConstruct
sigasiPortA VHDL port
sigasiConditionalProcessingVariableA VHDL conditional processing variable
sigasiSignalA VHDL signal
sigasiSubprogramParameterVariableA VHDL variable parameter of a task or function
sigasiSubprogramParameterSignalA VHDL signal parameter of a task or function
sigasiSubprogramParameterConstantA VHDL constant parameter of a task or function
sigasiConstantA VHDL constant or enumeration literal
sigasiAttributeA VHDL attribute
sigasiGenericConstantA VHDL generic constant value
sigasiGenericTypeA VHDL generic type declaration
sigasiGenericSubprogramA VHDL generic function or task

Customizing Your Setup

  1. Open VS Code Settings: Navigate to File > Preferences > Settings and search for editor.semanticTokenColorCustomizations.

  2. 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.

  3. 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.