fix(vipeye): 支持 project.json 子项目 source_dir 全局导入
findViperProjectConfigsInChildDirs 扫描一级子目录的 .vpj/project.json, 累计 source_dir 与 includes 到 defaultExtraPaths(去重而非覆盖), 使 App 根级 import lib.core.VLogger 可在 TransPyC 目录打开时正确解析。
This commit is contained in:
1 parent
d98cd60f7b
commit
5e07800c7c
1 file changed
+12
-2
@@ -1459,9 +1459,19 @@ export class AnalyzerService {
|
||||
});
|
||||
}
|
||||
|
||||
// 写入 defaultExtraPaths;_ensureDefaultOptions 检测到已设置时不会覆盖。
|
||||
// 累加写入 defaultExtraPaths(多个子项目配置时必须累加而非覆盖,
|
||||
// 否则后一个配置会挤掉前一个的 source_dir/includes);
|
||||
// _ensureDefaultOptions 检测到已设置时不会覆盖。
|
||||
if (extraPaths.length > 0) {
|
||||
configOptions.defaultExtraPaths = extraPaths;
|
||||
const existing = configOptions.defaultExtraPaths ?? [];
|
||||
const seen = new Set(existing.map((u) => u.key));
|
||||
for (const p of extraPaths) {
|
||||
if (!seen.has(p.key)) {
|
||||
existing.push(p);
|
||||
seen.add(p.key);
|
||||
}
|
||||
}
|
||||
configOptions.defaultExtraPaths = existing;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user