@@ -43,10 +43,55 @@ Tool names and versions are autocompleted in the `tools` section of a `mise.toml
4343
4444![ Screenshot showing autocompletion of tool version] ( ./autocomplete-tool-version.png )
4545
46+ In ` .tool-versions ` files, backend prefixes (` core: ` , ` npm: ` , ` cargo: ` , ...) are
47+ also autocompleted, and typing a prefix such as ` core: ` suggests the registry
48+ tools of that backend (e.g. ` core:node ` ).
49+
4650#### Autocompletion for tasks
4751
4852Code completion is provided for ` depends = ["task_name"] ` , ` depends_post = ["task_name"] ` , ` wait_for = ["task_name"] ` .
4953
54+ ### Task arguments (usage spec)
55+
56+ Task arguments are declared with the
57+ [ ` usage ` field] ( https://mise.jdx.dev/tasks/task-arguments.html ) of a task,
58+ using the [ usage spec] ( https://usage.jdx.dev/spec/ ) . The extension provides:
59+
60+ - ** Syntax highlighting** of ` usage = '''...''' ` blocks (KDL)
61+ - ** Context-aware autocompletion** : directives (` arg ` , ` flag ` , ` complete ` ) at
62+ the start of a line, the attributes valid for that directive after it
63+ (` help ` , ` default ` , ` choices ` blocks, ` count ` , ` negate ` , ...), without
64+ repeating attributes that are already set
65+ - ** Hover documentation** for directives and attributes
66+ - ** ` $usage_* ` variable completion** : typing ` $ ` in a multiline ` run ` block
67+ suggests the ` usage_* ` environment variables derived from the args and
68+ flags of that task
69+
70+ ``` toml
71+ [tasks .deploy ]
72+ usage = '''
73+ arg "<environment>" help="Target environment" {
74+ choices "dev" "staging" "prod"
75+ }
76+ flag "-v --verbose" help="Enable verbose output"
77+ '''
78+ run = '''
79+ echo "Deploying to ${usage_environment?}"
80+ '''
81+ ```
82+
83+ #### File tasks
84+
85+ The same support is available in shell
86+ [ file tasks] ( https://mise.jdx.dev/tasks/file-tasks.html ) :
87+
88+ - ` #USAGE ` lines get usage spec syntax highlighting, autocompletion, and hover
89+ - ` #MISE ` lines are highlighted as TOML, with autocompletion and hover for the
90+ [ task configuration keys] ( https://mise.jdx.dev/tasks/task-configuration.html )
91+ (` description ` , ` alias ` , ` depends ` , ` sources ` , ...)
92+ - Typing ` $ ` in the script body suggests the ` usage_* ` variables from the
93+ ` #USAGE ` lines
94+
5095### Code lens features
5196
5297This extension adds the following code lens features:
0 commit comments