mirror of
https://github.com/Microsoft/vscode
synced 2024-10-30 08:06:04 +00:00
debug: better launch schema updating
This commit is contained in:
parent
7c3f60f86e
commit
11d3a8027d
1 changed files with 8 additions and 1 deletions
|
@ -21,7 +21,11 @@ import { isCodeEditor } from 'vs/editor/browser/editorBrowser';
|
|||
import { launchSchema, debuggersExtPoint, breakpointsExtPoint } from 'vs/workbench/contrib/debug/common/debugSchemas';
|
||||
import { IQuickInputService } from 'vs/platform/quickinput/common/quickInput';
|
||||
import { IContextKeyService, IContextKey } from 'vs/platform/contextkey/common/contextkey';
|
||||
import { launchSchemaId } from 'vs/workbench/services/configuration/common/configuration';
|
||||
import { Registry } from 'vs/platform/registry/common/platform';
|
||||
import { IJSONContributionRegistry, Extensions as JSONExtensions } from 'vs/platform/jsonschemas/common/jsonContributionRegistry';
|
||||
|
||||
const jsonRegistry = Registry.as<IJSONContributionRegistry>(JSONExtensions.JSONContribution);
|
||||
export class AdapterManager implements IAdapterManager {
|
||||
|
||||
private debuggers: Debugger[];
|
||||
|
@ -81,8 +85,10 @@ export class AdapterManager implements IAdapterManager {
|
|||
});
|
||||
|
||||
// update the schema to include all attributes, snippets and types from extensions.
|
||||
const items = (<IJSONSchema>launchSchema.properties!['configurations'].items);
|
||||
items.oneOf = [];
|
||||
items.defaultSnippets = [];
|
||||
this.debuggers.forEach(adapter => {
|
||||
const items = (<IJSONSchema>launchSchema.properties!['configurations'].items);
|
||||
const schemaAttributes = adapter.getSchemaAttributes();
|
||||
if (schemaAttributes && items.oneOf) {
|
||||
items.oneOf.push(...schemaAttributes);
|
||||
|
@ -92,6 +98,7 @@ export class AdapterManager implements IAdapterManager {
|
|||
items.defaultSnippets.push(...configurationSnippets);
|
||||
}
|
||||
});
|
||||
jsonRegistry.registerSchema(launchSchemaId, launchSchema);
|
||||
|
||||
this._onDidDebuggersExtPointRead.fire();
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue