Skip to content

Distiction with Structs, Traits, Enums, Unions #6

@codeitlikemiley

Description

@codeitlikemiley

On vscode im using default them like this one
i've added some customization that allows me
to clearly distinguished different types

Vscode settings snippet
"editor.tokenColorCustomizations": {
    "[Default Dark Modern]": {
      "textMateRules": [
        {
          "scope": [
            "keyword.other.rust",
            "support.type",
            "support.type.primitive",
          ],
          "settings": {
            "foreground": "#569CD6"
          }
        },
        // Trait
        {
          "scope": [
            "entity.name.type.trait.rust"
          ],
          "settings": {
            "foreground": "#b681ef"
          }
        },
        // Enum, Struct, Union
        {
          "scope": [
            "entity.name.type.struct.rust",
            "entity.name.type.union.rust",
            "variable.other.property",
            "variable.other.member"
          ],
          "settings": {
            "foreground": "#4EC9B0"
          }
        },
        {
          "scope": [
            "entity.name.type.enum.rust",
            // "variable.other.enummember.rust"
          ],
          "settings": {
            "foreground": "#eca4c3"
          }
        },
        // Namespace
        {
          "scope": [
            "entity.name.namespace"
          ],
          "settings": {
            "foreground": "#ffffffb2"
          }
        },
        // Functions and Type Declarations
        {
          "scope": [
            "entity.name.type.declaration.rust",
            "entity.name.function.rust"
          ],
          "settings": {
            "foreground": "#DCDCAA"
          }
        },
        // Properties
        // Lifetimes and Parameters
        {
          "scope": [
            "storage.modifier.lifetime.rust",
            "variable.parameter"
          ],
          "settings": {
            "foreground": "#ed5c5c"
          }
        },
        // Comments
        {
          "scope": [
            "comment"
          ],
          "settings": {
            "fontStyle": "italic"
          }
        },
      ]
    },
  },

See Example
Screenshot 2024-07-09 at 10 37 06 AM

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions