pathの入力を省略可能に
This commit is contained in:
parent
4da4350dde
commit
e72f4fd61d
|
@ -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); // すべてのマーカーを収集
|
||||
|
|
|
@ -502,6 +502,7 @@ export const searchIndexes:SearchIndexItem[] = [
|
|||
label: i18n.ts.general,
|
||||
keywords: ['general'],
|
||||
icon: 'ti ti-adjustments',
|
||||
path: '/settings/general',
|
||||
},
|
||||
] as const;
|
||||
|
||||
|
|
Loading…
Reference in New Issue