Skip to content

Add variable to tasks.json for currently selected text #27466

@ptashka-berkut

Description

@ptashka-berkut

Variable substitutions that are available for tasks.json (see Integrate with External Tools via Tasks) do not include currently selected text. I am looking for something similar to $(CurText) that is available in Visual Studio Arguments for External Tools (see Managing External Tools).

{
    "version": "0.1.0",
    "tasks": [
        {
            "taskName": "ExternalProgram",
            "command": "externalprogram.exe",
            "isShellCommand": true,
            "args": [
                "${curtext}" // Or something similar
            ],
            "showOutput": "always"
        }
    ]
}

Please add a variable ${curtext} which would be replaced with the currently selected text in the editor window. If no selection is available, it could use the current line at cursor position.

Metadata

Metadata

Assignees

Labels

feature-requestRequest for new features or functionalitytasksTask system issuesverification-neededVerification of issue is requestedverifiedVerification succeeded

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions