-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Separate debug configuration providers from debug adapter contributors
The implementation of the vscode API for the resolution of initial debug configurations as well as the resolution of specific configurations was relying on the registered debug adapter contributors rather than debug configuration providers, this is causing issues e.g. #9978. This implementation brings access to the debug configuration providers all the way to the browser debug/plugin-debug-service, where the providers can be filtered and then call its corresponding API indirectly. The former API is kept as deprecated. Signed-off-by: Alvaro Sanchez-Leon <[email protected]>
- Loading branch information
Showing
11 changed files
with
330 additions
and
139 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,3 +31,4 @@ dev-packages/electron/compile_commands.json | |
scripts/download | ||
license-check-summary.txt* | ||
*-trace.json | ||
.tours |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
packages/plugin-ext/src/main/browser/debug/plugin-debug-configuration-provider.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
// ***************************************************************************** | ||
// Copyright (C) 2022 Ericsson and others. | ||
// | ||
// This program and the accompanying materials are made available under the | ||
// terms of the Eclipse Public License v. 2.0 which is available at | ||
// http://www.eclipse.org/legal/epl-2.0. | ||
// | ||
// This Source Code may also be made available under the following Secondary | ||
// Licenses when the conditions for such availability set forth in the Eclipse | ||
// Public License v. 2.0 are satisfied: GNU General Public License, version 2 | ||
// with the GNU Classpath Exception which is available at | ||
// https://www.gnu.org/software/classpath/license.html. | ||
// | ||
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 | ||
// ***************************************************************************** | ||
|
||
import { | ||
DebugConfigurationProvider, | ||
DebugConfigurationProviderDescriptor, | ||
DebugConfigurationProviderTriggerKind, | ||
DebugExt | ||
} from '../../../common/plugin-api-rpc'; | ||
import { DebugConfiguration } from '@theia/debug/lib/common/debug-configuration'; | ||
|
||
export class PluginDebugConfigurationProvider implements DebugConfigurationProvider { | ||
public handle: number; | ||
public type: string; | ||
public triggerKind: DebugConfigurationProviderTriggerKind; | ||
provideDebugConfigurations: (folder: string | undefined) => Promise<DebugConfiguration[]>; | ||
resolveDebugConfiguration: (folder: string | undefined, debugConfiguration: DebugConfiguration) => Promise<DebugConfiguration | undefined>; | ||
resolveDebugConfigurationWithSubstitutedVariables: (folder: string | undefined, debugConfiguration: DebugConfiguration) => Promise<DebugConfiguration | undefined>; | ||
|
||
constructor( | ||
description: DebugConfigurationProviderDescriptor, | ||
protected readonly debugExt: DebugExt | ||
) { | ||
this.handle = description.handle; | ||
this.type = description.type; | ||
this.triggerKind = description.trigger; | ||
|
||
if (description.provideDebugConfiguration) { | ||
this.provideDebugConfigurations = async (folder: string | undefined) => this.debugExt.$provideDebugConfigurationsByHandle(this.handle, folder); | ||
} | ||
|
||
if (description.resolveDebugConfigurations) { | ||
this.resolveDebugConfiguration = | ||
async (folder: string | undefined, debugConfiguration: DebugConfiguration) => | ||
this.debugExt.$resolveDebugConfigurationByHandle(this.handle, folder, debugConfiguration); | ||
} | ||
|
||
if (description.resolveDebugConfigurationWithSubstitutedVariables) { | ||
this.resolveDebugConfigurationWithSubstitutedVariables = | ||
async (folder: string | undefined, debugConfiguration: DebugConfiguration) => | ||
this.debugExt.$resolveDebugConfigurationWithSubstitutedVariablesByHandle(this.handle, folder, debugConfiguration); | ||
} | ||
} | ||
} |
Oops, something went wrong.