claui / vscode-taskwarrior

VS Code extension to manage Taskwarrior tasks

Home Page:https://marketplace.visualstudio.com/items?itemName=claui.taskwarrior

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Syntax highlighting for UDA `priority`

claui opened this issue · comments

For the priority attribute, I’d like to have a udaPriorityEntry pattern added to the grammar.
The pattern should provide these scopes:

  • meta.section.uda.key.priority
  • variable.other.enummember.uda.priority
  • invalid.illegal.uda.priority

Implementation should be straightforward, and similar to the parentEntry pattern I already have:

"udaPriorityEntry": {
    "match": "(UDA priority:)\\s*(.*)",
    "captures": {
        "1": {
            "name": "meta.section.uda.key.priority",
            "patterns": [
                {
                    "include": "#attributeKeySection"
                }
            ]
        },
        "2": {
            "patterns": [
                {
                    "include": "#udaPriority"
                },
                {
                    "match": ".*",
                    "name": "invalid.illegal.uda.priority"
                }
            ]
        }
    }
},

[…]

"udaPriority": {
    "match": "L|M|H",
    "name": "variable.other.enummember.uda.priority"
},