提交 b234792b 编写于 作者: A Alex Dima

Make the snippet contribution point dynamic

上级 a73a315a
......@@ -107,6 +107,7 @@ namespace snippetExt {
};
export const point = ExtensionsRegistry.registerExtensionPoint<snippetExt.ISnippetsExtensionPoint[]>({
isDynamic: true,
extensionPoint: 'snippets',
deps: [languagesExtPoint],
jsonSchema: snippetExt.snippetsContribution
......@@ -207,6 +208,13 @@ class SnippetsService implements ISnippetsService {
private _initExtensionSnippets(): void {
snippetExt.point.setHandler(extensions => {
this._files.forEach((value, key) => {
if (value.source === SnippetSource.Extension) {
this._files.delete(key);
}
});
for (const extension of extensions) {
for (const contribution of extension.value) {
const validContribution = snippetExt.toValidSnippet(extension, contribution, this._modeService);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册