Skip to content

Commit c599e9f

Browse files
committed
Merged PR 472954: Move to using IDotnetDebugConfigurationService
Move to using IDotnetDebugConfigurationService This PR moves from calling ILaunchConfigurationService and IBuildService to IDotnetDebugConfigurationService.
1 parent e30515c commit c599e9f

File tree

8 files changed

+67
-272
lines changed

8 files changed

+67
-272
lines changed

src/lsptoolshost/debugger.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export function registerDebugger(context: vscode.ExtensionContext, languageServe
2626
context.subscriptions.push(disposable);
2727

2828
// Register ConfigurationProvider
29-
context.subscriptions.push(vscode.debug.registerDebugConfigurationProvider('dotnet', new DotnetConfigurationResolver(workspaceInformationProvider, platformInfo)));
29+
context.subscriptions.push(vscode.debug.registerDebugConfigurationProvider('dotnet', new DotnetConfigurationResolver(workspaceInformationProvider)));
3030
context.subscriptions.push(vscode.debug.registerDebugConfigurationProvider('coreclr', new DotnetWorkspaceConfigurationProvider(workspaceInformationProvider, platformInfo, optionProvider, csharpOutputChannel)));
3131
context.subscriptions.push(vscode.commands.registerCommand('dotnet.generateAssets', async (selectedIndex) => generateAssets(workspaceInformationProvider, selectedIndex)));
3232
}

src/lsptoolshost/services/Descriptors.ts

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -18,25 +18,8 @@ export default class Descriptors {
1818
),
1919
);
2020

21-
/**
22-
* The descriptor for the Project System launch configuration service.
23-
* Use {@link ILaunchConfigurationService} for the RPC interface.
24-
*/
25-
static readonly launchConfigurationService = new ServiceJsonRpcDescriptor(
26-
ServiceMoniker.create('Microsoft.VisualStudio.LaunchConfigurationService', undefined),
27-
Formatters.Utf8,
28-
MessageDelimiters.HttpLikeHeaders,
29-
{
30-
protocolMajorVersion: 3
31-
}
32-
);
33-
34-
/**
35-
* The descriptor for the Build service.
36-
* Use {@link IBuildService} for the RPC interface.
37-
*/
38-
static readonly buildService = new ServiceJsonRpcDescriptor(
39-
ServiceMoniker.create('Microsoft.VisualStudio.BuildService', '0.1'),
21+
static readonly dotnetDebugConfigurationService: ServiceRpcDescriptor = new ServiceJsonRpcDescriptor(
22+
ServiceMoniker.create('Microsoft.VisualStudio.Debugger.DotnetDebugConfigurationService', '0.1'),
4023
Formatters.MessagePack, MessageDelimiters.BigEndianInt32LengthHeader,
4124
{
4225
protocolMajorVersion: 3

src/lsptoolshost/services/IBuildService.ts

Lines changed: 0 additions & 27 deletions
This file was deleted.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/*---------------------------------------------------------------------------------------------
2+
* Copyright (c) Microsoft Corporation. All rights reserved.
3+
* Licensed under the MIT License. See License.txt in the project root for license information.
4+
*--------------------------------------------------------------------------------------------*/
5+
6+
import * as vscode from 'vscode';
7+
8+
export enum DotnetDebugConfigurationServiceErrorKind {
9+
internalError = 'internalError',
10+
launchCancelled = 'launchCancelled',
11+
userError = 'userError',
12+
}
13+
14+
export interface IDotnetDebugConfigurationServiceError {
15+
kind: DotnetDebugConfigurationServiceErrorKind;
16+
message?: string | undefined;
17+
}
18+
19+
export interface IDotnetDebugConfigurationServiceResult {
20+
configurations: vscode.DebugConfiguration[];
21+
error?: IDotnetDebugConfigurationServiceError | undefined;
22+
}
23+
24+
export interface IDotnetDebugConfigurationService {
25+
resolveDebugConfigurationWithLaunchConfigurationService(
26+
projectPath: string,
27+
debugConfiguration: vscode.DebugConfiguration,
28+
token?: vscode.CancellationToken,
29+
): Promise<IDotnetDebugConfigurationServiceResult>;
30+
}

src/lsptoolshost/services/ILaunchConfigurationService.ts

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

src/lsptoolshost/services/brokeredServicesHosting.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ export function getBrokeredServiceContainer(): CSharpExtensionServiceBroker {
2020
// Register any brokered services that come from other extensions so that we can proffer them later.
2121

2222
_csharpExtensionServiceBroker.registerExternalServices(
23-
Descriptors.launchConfigurationService.moniker,
24-
Descriptors.buildService.moniker
23+
Descriptors.dotnetDebugConfigurationService.moniker
2524
);
2625
}
2726
return _csharpExtensionServiceBroker;

src/main.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,8 +280,7 @@ function tryGetCSharpDevKitExtensionExports(csharpLogObserver: CsharpLoggerObser
280280
// This list must be a subset of the monikers previously registered with our own container
281281
// as defined in the getBrokeredServiceContainer function.
282282
getBrokeredServiceContainer().profferServiceBroker(exports.serviceBroker, [
283-
Descriptors.launchConfigurationService.moniker,
284-
Descriptors.buildService.moniker
283+
Descriptors.dotnetDebugConfigurationService.moniker
285284
]
286285
);
287286

0 commit comments

Comments
 (0)