pathの入力を省略可能に

This commit is contained in:
tai-cha 2025-03-03 01:06:53 +09:00
parent 4da4350dde
commit e72f4fd61d
No known key found for this signature in database
GPG Key ID: 1D5EE39F870DC283
2 changed files with 6 additions and 2 deletions

View File

@ -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<string, SearchIndexItem>();
@ -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); // すべてのマーカーを収集

View File

@ -502,6 +502,7 @@ export const searchIndexes:SearchIndexItem[] = [
label: i18n.ts.general,
keywords: ['general'],
icon: 'ti ti-adjustments',
path: '/settings/general',
},
] as const;