Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>Inline Go Struct Tags Syntax HighlightNew to Visual Studio Code? Get it now.
Inline Go Struct Tags Syntax Highlight

Inline Go Struct Tags Syntax Highlight

fogio

|
18 installs
| (1) | Free
Highlight golang struct tags according to your theme
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Inline Go Struct Tags Syntax Highlight Extension for VS Code

Highlight golang struct tags according to your theme

Version  Rating  INSTALLS  DOWNLOADS

Preview

Your theme's default colors

preview-1

preview-2

Customization

preview-3

Install

By default, some VS Code themes use semantic highlighting, which overrides custom struct tag highlighting with a simple string. To use this extension with such themes, you need to disable semantic highlighting for Go files:

Option 1: Disable only for Go

"[go]": {
  "editor.semanticHighlighting.enabled": false
}

Option 2: Disable globally

"editor.semanticHighlighting.enabled": false

Add this to your settings.json (open Command Palette → Preferences: Open Settings (JSON)).


Customizing Colors in User Settings

You can customize the colors for struct tag keys and values using editor.tokenColorCustomizations in your settings.json.

Font style

custom-font-style

"editor.tokenColorCustomizations": {
  "textMateRules": [
    {
      "scope": "meta.struct-tag.pair.go support.type.property-name.json", // struct tag key
      "settings": {
        "fontStyle": "bold underline"
      }
    },
    {
      "scope": "meta.struct-tag.pair.go punctuation.separator.dictionary.key-value.json", // struct tag separator (colon)
      "settings": {
        "fontStyle": ""
      }
    },
    {
      "scope": "meta.struct-tag.pair.go string.quoted.double.json", // struct tag value
      "settings": {
        "fontStyle": "italic"
      }
    }
  ]
}

Font color

custom-font-color

"editor.tokenColorCustomizations": {
  "textMateRules": [
    {
      "scope": "meta.struct-tag.pair.go support.type.property-name.json", // struct tag key
      "settings": {
        "foreground": "#9876AA",
      }
    },
    {
      "scope": "meta.struct-tag.pair.go punctuation.separator.dictionary.key-value.json", // struct tag separator (colon)
      "settings": {
        "foreground": "#BCBEC4"
      }
    },
    {
      "scope": "meta.struct-tag.pair.go string.quoted.double.json", // struct tag value
      "settings": {
        "foreground": "#6A8759",
      }
    }
  ]
}

Font style with color

custom-font-style-with-color

"editor.tokenColorCustomizations": {
  "textMateRules": [
    {
      "scope": "meta.struct-tag.pair.go support.type.property-name.json", // struct tag key
      "settings": {
        "foreground": "#9876AA",
        "fontStyle": "bold"
      }
    },
    {
      "scope": "meta.struct-tag.pair.go punctuation.separator.dictionary.key-value.json", // struct tag separator (colon)
      "settings": {
        "foreground": "#BCBEC4"
      }
    },
    {
      "scope": "meta.struct-tag.pair.go string.quoted.double.json", // struct tag value
      "settings": {
        "foreground": "#6A8759",
        "fontStyle": "italic"
      }
    }
  ]
}
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft