feat: 添加vscode编辑器
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
import * as Assert from '../../../base/common/assert.js';
|
||||
import * as Types from '../../../base/common/types.js';
|
||||
class RegistryImpl {
|
||||
constructor() {
|
||||
this.data = new Map();
|
||||
}
|
||||
add(id, data) {
|
||||
Assert.ok(Types.isString(id));
|
||||
Assert.ok(Types.isObject(data));
|
||||
Assert.ok(!this.data.has(id), 'There is already an extension with this id');
|
||||
this.data.set(id, data);
|
||||
}
|
||||
as(id) {
|
||||
return this.data.get(id) || null;
|
||||
}
|
||||
}
|
||||
export const Registry = new RegistryImpl();
|
||||
Reference in New Issue
Block a user