feat: 添加vscode编辑器

This commit is contained in:
dhx
2022-09-29 16:48:09 +08:00
parent a93bdac4ff
commit 150898ec1e
1126 changed files with 933348 additions and 0 deletions
@@ -0,0 +1,30 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { Emitter } from '../../../base/common/event.js';
import * as platform from '../../registry/common/platform.js';
export const Extensions = {
JSONContribution: 'base.contributions.json'
};
function normalizeId(id) {
if (id.length > 0 && id.charAt(id.length - 1) === '#') {
return id.substring(0, id.length - 1);
}
return id;
}
class JSONContributionRegistry {
constructor() {
this._onDidChangeSchema = new Emitter();
this.schemasById = {};
}
registerSchema(uri, unresolvedSchemaContent) {
this.schemasById[normalizeId(uri)] = unresolvedSchemaContent;
this._onDidChangeSchema.fire(uri);
}
notifySchemaChanged(uri) {
this._onDidChangeSchema.fire(uri);
}
}
const jsonContributionRegistry = new JSONContributionRegistry();
platform.Registry.add(Extensions.JSONContribution, jsonContributionRegistry);