Skip to content

Commit

Permalink
#8755: Apply problem matchers specified by task provider
Browse files Browse the repository at this point in the history
Signed-off-by: Miro Spönemann <[email protected]>
  • Loading branch information
spoenemann committed Nov 19, 2020
1 parent cd85908 commit 4d25f75
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions packages/plugin-ext/src/common/plugin-api-rpc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1213,6 +1213,9 @@ export interface TaskDto {
label: string;
source?: string;
scope: string | number;
// Provide a more specific type when necessary (see ProblemMatcherContribution)
// eslint-disable-next-line @typescript-eslint/no-explicit-any
problemMatcher?: any;
detail?: string;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
[key: string]: any;
Expand Down
5 changes: 4 additions & 1 deletion packages/plugin-ext/src/plugin/type-converters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -705,6 +705,9 @@ export function fromTask(task: theia.Task): TaskDto | undefined {
const taskDto = {} as TaskDto;
taskDto.label = task.name;
taskDto.source = task.source;
if (task.problemMatchers) {
taskDto.problemMatcher = task.problemMatchers;
}
if ('detail' in task) {
taskDto.detail = (task as theia.Task2).detail;
}
Expand Down Expand Up @@ -748,7 +751,7 @@ export function toTask(taskDto: TaskDto): theia.Task {
throw new Error('Task should be provided for converting');
}

const { type, label, source, scope, detail, command, args, options, windows, ...properties } = taskDto;
const { type, label, source, scope, problemMatcher, detail, command, args, options, windows, ...properties } = taskDto;
const result = {} as theia.Task;
result.name = label;
result.source = source;
Expand Down

0 comments on commit 4d25f75

Please sign in to comment.