@@ -9,23 +9,16 @@ import Filters = require('vs/base/common/filters');
99import { TPromise } from 'vs/base/common/winjs.base' ;
1010import { Action , IAction } from 'vs/base/common/actions' ;
1111import { IStringDictionary } from 'vs/base/common/collections' ;
12- import * as Objects from 'vs/base/common/objects' ;
1312
1413import Quickopen = require( 'vs/workbench/browser/quickopen' ) ;
1514import QuickOpen = require( 'vs/base/parts/quickopen/common/quickOpen' ) ;
1615import Model = require( 'vs/base/parts/quickopen/browser/quickOpenModel' ) ;
17- import { IQuickOpenService , IPickOpenEntry } from 'vs/platform/quickOpen/common/quickOpen' ;
18- import { ProblemMatcherRegistry , NamedProblemMatcher } from 'vs/platform/markers/common/problemMatcher' ;
16+ import { IQuickOpenService } from 'vs/platform/quickOpen/common/quickOpen' ;
1917
2018import { Task , TaskSourceKind } from 'vs/workbench/parts/tasks/common/tasks' ;
21- import { ITaskService } from 'vs/workbench/parts/tasks/common/taskService' ;
19+ import { ITaskService , RunOptions } from 'vs/workbench/parts/tasks/common/taskService' ;
2220import { ActionBarContributor , ContributableActionProvider } from 'vs/workbench/browser/actions' ;
2321
24- interface ProblemMatcherPickEntry extends IPickOpenEntry {
25- matcher : NamedProblemMatcher ;
26- learnMore ?: boolean ;
27- }
28-
2922export class TaskEntry extends Model . QuickOpenEntry {
3023
3124 constructor ( protected taskService : ITaskService , protected quickOpenService : IQuickOpenService , protected _task : Task , highlights : Model . IHighlight [ ] = [ ] ) {
@@ -44,53 +37,8 @@ export class TaskEntry extends Model.QuickOpenEntry {
4437 return this . _task ;
4538 }
4639
47- protected attachProblemMatcher ( task : Task ) : TPromise < Task > {
48- let entries : ProblemMatcherPickEntry [ ] = [ ] ;
49- for ( let key of ProblemMatcherRegistry . keys ( ) ) {
50- let matcher = ProblemMatcherRegistry . get ( key ) ;
51- if ( matcher . name === matcher . label ) {
52- entries . push ( { label : matcher . name , matcher : matcher } ) ;
53- } else {
54- entries . push ( {
55- label : matcher . label ,
56- description : `$${ matcher . name } ` ,
57- matcher : matcher
58- } ) ;
59- }
60- }
61- if ( entries . length > 0 ) {
62- entries = entries . sort ( ( a , b ) => a . label . localeCompare ( b . label ) ) ;
63- entries [ 0 ] . separator = { border : true } ;
64- entries . unshift (
65- { label : nls . localize ( 'continueWithout' , 'Continue without scanning the build output' ) , matcher : undefined } ,
66- { label : nls . localize ( 'learnMoreAbout' , 'Learn more about scanning the build output' ) , matcher : undefined , learnMore : true }
67- ) ;
68- return this . quickOpenService . pick ( entries , {
69- placeHolder : nls . localize ( 'selectProblemMatcher' , 'Select for which kind of errors and warnings to scan the build output' )
70- } ) . then ( ( selected ) => {
71- if ( selected ) {
72- if ( selected . learnMore ) {
73- this . taskService . openDocumentation ( ) ;
74- return undefined ;
75- } else if ( selected . matcher ) {
76- let newTask = Objects . deepClone ( task ) ;
77- let matcherReference = `$${ selected . matcher . name } ` ;
78- newTask . problemMatchers = [ matcherReference ] ;
79- this . taskService . customize ( task , { problemMatcher : [ matcherReference ] } , true ) ;
80- return newTask ;
81- } else {
82- return task ;
83- }
84- } else {
85- return task ;
86- }
87- } ) ;
88- }
89- return TPromise . as ( task ) ;
90- }
91-
92- protected doRun ( task : Task ) : boolean {
93- this . taskService . run ( task ) ;
40+ protected doRun ( task : Task , options ?: RunOptions ) : boolean {
41+ this . taskService . run ( task , options ) ;
9442 if ( task . command . presentation . focus ) {
9543 this . quickOpenService . close ( ) ;
9644 return false ;
0 commit comments