Support bazel
tasks from tasks.json
#346
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
User-facing changes
This commit fixes two user-facing bugs:
taskDefinition
for bazel tasks. However, trying to actually define such a task in thetasks.json
resulted in the same error message.In both cases, the user was presented with the error message
This commit fixes the issue, such that rerunning tasks from the history and configuring tasks through
tasks.json
now works properly.Furthermore, the
taskDefinition
inside thepackage.json
was improved:command
options, such that we have auto-completion within thetasks.json
editor.targets
entries to be string-typed.options
argument which allows to specify additional command line parameters.Code changes
Fixing the issue mainly required registering a
TaskProvider
forbazel
tasks. TheTaskProvider
currently does not auto-detect the available tasks, but only implementsresolveTask
.The notifications in
onTaskProcessEnd
had to be refactored: So far, theBazelTaskInfo
was attached right during task creation. However, this didn't work for the newresolveTask
.resolveTask
apparently isn't allowed to change a task's definition. To make notifications work, theBazelTaskInfo
is now attached in theonTaskStart
callback.Many of the fields of the
BazelTaskInfo
were unused. This commit removescommandOptions
,processId
,exitCode
all of which were stored but never read. Doing so, it turned out that theonTaskProcessStart
was no longer necessary.Lastly, the callbacks used for task notifications were moved from
extension.ts
tobazel_task_info.ts
and activation of all task-related functionality was centralized in theactivateTaskProvider
functionBEGIN_COMMIT_OVERRIDE
feat: Support bazel tasks from tasks.json (#346)
END_COMMIT_OVERRIDE