Skip to content

When working with a Token, it would be useful to know which Language it came from #48

@dvclmn

Description

@dvclmn

Token provides a name and range property, but there is currently no way to verify which language configuration is providing which token.

let provider: TokenAttributeProvider = { token in
      
    print("Token: \(token)")

    return switch token.name {
        case let keyword where keyword == "punctuation.delimiter": [.foregroundColor: NSColor.red]
        case let keyword where keyword == "text.title": [.foregroundColor: NSColor.green]
        default: [.foregroundColor: NSColor.blue]
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions