diff --git a/server/src/modes/template/tagProviders/componentInfoTagProvider.ts b/server/src/modes/template/tagProviders/componentInfoTagProvider.ts index dadf0ecf43..0e93fe4dfa 100644 --- a/server/src/modes/template/tagProviders/componentInfoTagProvider.ts +++ b/server/src/modes/template/tagProviders/componentInfoTagProvider.ts @@ -13,7 +13,8 @@ import { ChildComponent } from '../../../services/vueInfoService'; import { MarkupContent } from 'vscode-languageserver-types'; export function getComponentInfoTagProvider(childComponents: ChildComponent[]): IHTMLTagProvider { - const tags: ITagSet = {}; + const tagSet: ITagSet = {}; + for (const cc of childComponents) { const props: Attribute[] = []; if (cc.info && cc.info.componentInfo.props) { @@ -21,23 +22,28 @@ export function getComponentInfoTagProvider(childComponents: ChildComponent[]): props.push(genAttribute(p.name, undefined, { kind: 'markdown', value: p.documentation || '' })); }); } - tags[cc.name] = new HTMLTagSpecification({ - kind: 'markdown', - value: cc.documentation || '' - }, props); + tagSet[cc.name] = new HTMLTagSpecification( + { + kind: 'markdown', + value: cc.documentation || '' + }, + props + ); + tagSet[cc.name.toLowerCase()] = tagSet[cc.name]; } + return { getId: () => 'component', priority: Priority.UserCode, - collectTags: collector => collectTagsDefault(collector, tags), + collectTags: collector => collectTagsDefault(collector, tagSet), collectAttributes: ( tag: string, collector: (attribute: string, type?: string, documentation?: string | MarkupContent) => void ) => { - collectAttributesDefault(tag, collector, tags, []); + collectAttributesDefault(tag, collector, tagSet, []); }, collectValues: (tag: string, attribute: string, collector: (value: string) => void) => { - collectValuesDefault(tag, attribute, collector, tags, [], {}); + collectValuesDefault(tag, attribute, collector, tagSet, [], {}); } }; }