Skip to content

Commit 6e493ac

Browse files
author
Loïc Mangeonjean
committed
Revert "feat: allow overriding shouldReattach on task service"
This reverts commit 2faf6c8.
1 parent 59cd15f commit 6e493ac

3 files changed

Lines changed: 26 additions & 120 deletions

File tree

src/missing-services.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1648,7 +1648,6 @@ class TaskService implements ITaskService {
16481648
@Unsupported
16491649
extensionCallbackTaskComplete: ITaskService['extensionCallbackTaskComplete'] = unsupported
16501650
isReconnected: ITaskService['isReconnected'] = false
1651-
shouldReattach: ITaskService['shouldReattach'] = false
16521651
onDidReconnectToTasks: ITaskService['onDidReconnectToTasks'] = Event.None
16531652

16541653
getTerminalsForTasks: ITaskService['getTerminalsForTasks'] = () => undefined

src/service-override/task.ts

Lines changed: 26 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -46,28 +46,9 @@ import {
4646
import { IViewDescriptorService } from 'vs/workbench/common/views.service'
4747
import '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-
6849
class 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
}

vscode-patches/0085-refactor-extract-shouldReattach-flag.patch

Lines changed: 0 additions & 88 deletions
This file was deleted.

0 commit comments

Comments
 (0)