Skip to content

Instantly share code, notes, and snippets.

@nataliemarleny
Last active July 20, 2019 12:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nataliemarleny/15a6a6754bdbbe2aa1f532a9cb467ad3 to your computer and use it in GitHub Desktop.
Save nataliemarleny/15a6a6754bdbbe2aa1f532a9cb467ad3 to your computer and use it in GitHub Desktop.
tasks.json

Suggestion / Tiny Bug:

  • A description of the problem you're trying to solve:

./.vscode > tasks.json contains deprecated API tasks.identifier.

Reference: microsoft/vscode#57946 Further discussion see thread containing: microsoft/vscode#57707 (comment) Schema for tasks.json: https://code.visualstudio.com/docs/editor/tasks-appendix

  • An overview of the suggested solution Either:

Note: tasks.identifier in tasks.json was introduced: 41567b2261 - Migrate tscWatchMode to vfs

update tasks API to new supported feature: TaskDefinitions: https://code.visualstudio.com/api/references/contribution-points#contributes.taskDefinitions

Documentation https://code.visualstudio.com/api/references/contribution-points#contributes.taskDefinitions

Update: Install gulp using README.md steps, Cmd + Shift + B runs the gulp tests

Resolution: going to update the tasks.json to contain a task for each gulp item listed in README.md

gulp local            # Build the compiler into built/local
gulp clean            # Delete the built compiler
gulp LKG              # Replace the last known good with the built one.
                      # Bootstrapping step to be executed when the built compiler reaches a stable state.
gulp tests            # Build the test infrastructure using the built compiler.
gulp runtests         # Run tests using the built compiler and test infrastructure.
                      # You can override the host or specify a test for this command.
                      # Use --host=<hostName> or --tests=<testPath>.
gulp baseline-accept  # This replaces the baseline test results with the results obtained from gulp runtests.
gulp lint             # Runs tslint on the TypeScript source.
gulp help             # List the above commands.

Gulpfile.js update to Gulpfile.ts

So tasks.json only needs configured tasks - out of the detected tasks see if there are any tests left which need configuring.

api for tasks (array of objects): (* in use) (_ checked) (? not listed)

  • _args *
  • _command *
  • ?dependsOn
  • ?dependsOrder
  • ?executionId
  • _file
  • _group *
  • _isBackground
  • _label *
  • _linux
  • ?option
  • _options
  • _osx
  • path
  • _presentation
  • _problemMatcher *
  • ?promptOnClose
  • _runOptions
  • ?script
  • ?task
  • ?taskUid
  • ?tsconfig
  • _type *
  • _windows

this is the api documentation: https://code.visualstudio.com/docs/editor/tasks-appendix

Adds optional:

  • tasks
  • cwd
  • env
  • shell {
    • executable
    • args? }
  • reveal
  • echo
  • focus
  • panel
  • base
  • owner
  • severity
  • fileLocation
  • pattern
  • background
  • activeOnStart
  • beginsPattern
  • endsPattern
  • kind
  • location
  • line
  • column
  • endLine
  • endColumn
  • severity
  • code
  • loop
  • reevaluateOnRerun
  • runOn

===== not listed

  • regexp
  • message

===================== Reference - tasks.json from original question asker: https://github.com/microsoft/vscode-azurefunctions/blob/master/.vscode/tasks.json

Reference - tasks.json containing dependsOn: microsoft/vscode#31731

=====================

For reference, the VSCode lint error message under identifier reads:

"User defined identifiers are deprecated. For custom task use the name as a reference and for tasks provided by extensions use their defined task identifier. A user defined identifier to reference the task in launch.json or a dependsOn clause."

=========================

Issue in VSCode: microsoft/vscode#57707

Schema: https://code.visualstudio.com/docs/editor/tasks-appendix

Docs for tasks.json: https://code.visualstudio.com/docs/editor/tasks#_convert-from-010-to-200

Just in case: https://github.com/Microsoft/vscode/blob/master/src/vs/vscode.d.ts#L4693

https://code.visualstudio.com/api/extension-guides/task-provider

Side note: in .gitignore, tasks.json is listed but not ignored. Boolean operator would indicate it is very specifically tracked

https://github.com/microsoft/TypeScript/blob/a24e4b0d2ca34b6ad12aae9218ea4e2f9ddd32f4/.gitignore#L62

===================

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment