@@ -46,28 +46,9 @@ import {
4646import { IViewDescriptorService } from 'vs/workbench/common/views.service'
4747import 'vs/workbench/contrib/tasks/browser/task.contribution'
4848
49- export interface ForcedSupportedExecutions {
50- custom ?: boolean
51- shell ?: boolean
52- process ?: boolean
53- }
54- export interface TaskServiceOverrideParams {
55- /**
56- * By default, only custom tasks are supported
57- * When using the VSCode server, the server registers all the task types as supported
58- * But if the user has registered custom terminal backends, they may want to force support for other task types
59- */
60- forcedSupportedExecutions ?: ForcedSupportedExecutions
61-
62- /**
63- * Force task reattach, no matter the lifecycle startup kind
64- */
65- shouldReattach ?: boolean
66- }
67-
6849class CustomTaskService extends TaskService {
6950 constructor (
70- private params : TaskServiceOverrideParams ,
51+ forcedSupportedExecutions : ForcedSupportedExecutions | undefined ,
7152 @IConfigurationService _configurationService : IConfigurationService ,
7253 @IMarkerService _markerService : IMarkerService ,
7354 @IOutputService _outputService : IOutputService ,
@@ -150,24 +131,38 @@ class CustomTaskService extends TaskService {
150131 _chatAgentService
151132 )
152133
153- if ( params . forcedSupportedExecutions != null ) {
134+ if ( forcedSupportedExecutions != null ) {
154135 this . registerSupportedExecutions (
155- params . forcedSupportedExecutions . custom ,
156- params . forcedSupportedExecutions . shell ,
157- params . forcedSupportedExecutions . process
136+ forcedSupportedExecutions . custom ,
137+ forcedSupportedExecutions . shell ,
138+ forcedSupportedExecutions . process
158139 )
159140 }
160141 }
142+ }
161143
162- override get shouldReattach ( ) : boolean {
163- return this . params . shouldReattach ?? super . shouldReattach
164- }
144+ export interface ForcedSupportedExecutions {
145+ custom ?: boolean
146+ shell ?: boolean
147+ process ?: boolean
148+ }
149+ export interface TaskServiceOverrideParams {
150+ /**
151+ * By default, only custom tasks are supported
152+ * When using the VSCode server, the server registers all the task types as supported
153+ * But if the user has registered custom terminal backends, they may want to force support for other task types
154+ */
155+ forcedSupportedExecutions ?: ForcedSupportedExecutions
165156}
166157
167- export default function getServiceOverride (
168- params : TaskServiceOverrideParams = { }
169- ) : IEditorOverrideServices {
158+ export default function getServiceOverride ( {
159+ forcedSupportedExecutions
160+ } : TaskServiceOverrideParams = { } ) : IEditorOverrideServices {
170161 return {
171- [ ITaskService . toString ( ) ] : new SyncDescriptor ( CustomTaskService , [ params ] , true )
162+ [ ITaskService . toString ( ) ] : new SyncDescriptor (
163+ CustomTaskService ,
164+ [ forcedSupportedExecutions ] ,
165+ true
166+ )
172167 }
173168}
0 commit comments