actboy168 / vscode-tasks

MIT License
37 stars 14 forks source link

Support showing / hiding based on active file editor #12

Closed lucono closed 4 years ago

lucono commented 4 years ago

This adds support to allow enabling statusbar items only when specific types of files are active in the editor. Not providing the filePattern attribute simply retains the previous behavior where the statusbar item is always displayed if not configured as hidden. (The new attribute only acts on statusbar items that are not effectively set as hidden through the combination of tasks.json or the settings.json global setting).

For example, the following would only display the "Test" button when the active editor is for a filename that begins with _test:

"label": "Test",
"options": {
  "statusbar": {
    "filePattern" : "test_.*"
  }
}
actboy168 commented 4 years ago

Merged, thank you!

lucono commented 4 years ago

Thanks @actboy168! Looking forward to the release on VSCode marketplace when I'll be able to use the enhancement.