feat: print location of errors during documentation

main
Henrik 2023-09-10 01:02:52 +02:00
parent b2119d4db6
commit 6abc8bb769
1 changed files with 5 additions and 1 deletions

View File

@ -134,7 +134,11 @@ def process (task : AnalyzeTask) : MetaM (AnalyzerResult × Hierarchy) := do
let module := res.find! moduleName let module := res.find! moduleName
res := res.insert moduleName {module with members := module.members.push (ModuleMember.docInfo dinfo)} res := res.insert moduleName {module with members := module.members.push (ModuleMember.docInfo dinfo)}
catch e => catch e =>
IO.println s!"WARNING: Failed to obtain information for: {name}: {← e.toMessageData.toString}" if let some pos := e.getRef.getPos? then
let pos := (← getFileMap).toPosition pos
IO.println s!"WARNING: Failed to obtain information in file: {pos}, for: {name}, {← e.toMessageData.toString}"
else
IO.println s!"WARNING: Failed to obtain information for: {name}: {← e.toMessageData.toString}"
-- TODO: This could probably be faster if we did sorted insert above instead -- TODO: This could probably be faster if we did sorted insert above instead
for (moduleName, module) in res.toArray do for (moduleName, module) in res.toArray do