-
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
353 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
63 changes: 63 additions & 0 deletions
63
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,63 @@ | ||
// ***************************************************************************** | ||
// 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 { DebugExt } from '../../../common/plugin-api-rpc'; | ||
import { DebugConfiguration } from '@theia/debug/lib/common/debug-configuration'; | ||
import { DebugConfigurationProvider, DebugConfigurationProviderDescriptor, DebugConfigurationProviderTriggerKind } from '@theia/debug/lib/common/debug-service'; | ||
|
||
export class PluginDebugConfigurationProvider implements DebugConfigurationProvider { | ||
private _handle: number; | ||
private _type: string; | ||
private trigger: 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.trigger = 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); | ||
} | ||
} | ||
|
||
get handle(): number { | ||
return this._handle; | ||
} | ||
|
||
get type(): string { | ||
return this._type; | ||
} | ||
|
||
get triggerKind(): DebugConfigurationProviderTriggerKind { | ||
return this.trigger; | ||
} | ||
} |
Oops, something went wrong.