diff --git a/packages/frontend/lib/vite-plugin-create-search-index.ts b/packages/frontend/lib/vite-plugin-create-search-index.ts index 120ec8d132..2d7d71473d 100644 --- a/packages/frontend/lib/vite-plugin-create-search-index.ts +++ b/packages/frontend/lib/vite-plugin-create-search-index.ts @@ -740,7 +740,7 @@ function extractLabelsAndKeywords(nodes: VueAstNode[]): { label: string | null, function extractUsageInfoFromTemplateAst( templateAst: any, - code: string, + id: string, ): SearchIndexItem[] { const allMarkers: SearchIndexItem[] = []; const markerMap = new Map(); @@ -789,6 +789,9 @@ function extractUsageInfoFromTemplateAst( } } + //pathがない場合はファイルパスを設定 + if (markerInfo.path == null && parentId == null) markerInfo.path = id.match(/.*(\/settings\/[^\/]+)\.vue$/)?.[1]; + // SearchLabelとSearchKeywordを抽出 (AST全体を探索) if (node.children && Array.isArray(node.children)) { console.log(`Processing marker ${markerId} for labels and keywords`); @@ -1050,7 +1053,7 @@ export async function analyzeVueProps(options: { continue; // エラーが発生したファイルはスキップ } - const fileMarkers = extractUsageInfoFromTemplateAst(descriptor.template?.ast, options.transformedCodeCache[id]); + const fileMarkers = extractUsageInfoFromTemplateAst(descriptor.template?.ast, id); if (fileMarkers && fileMarkers.length > 0) { allMarkers.push(...fileMarkers); // すべてのマーカーを収集 diff --git a/packages/frontend/src/scripts/autogen/settings-search-index.ts b/packages/frontend/src/scripts/autogen/settings-search-index.ts index bddcc70e7f..49e30e29df 100644 --- a/packages/frontend/src/scripts/autogen/settings-search-index.ts +++ b/packages/frontend/src/scripts/autogen/settings-search-index.ts @@ -502,6 +502,7 @@ export const searchIndexes:SearchIndexItem[] = [ label: i18n.ts.general, keywords: ['general'], icon: 'ti ti-adjustments', + path: '/settings/general', }, ] as const;