feat: hide macro scopes encoding when displaying errors
This commit is contained in:
parent
3cb1d01130
commit
35179809a2
2 changed files with 11 additions and 4 deletions
|
|
@ -769,10 +769,9 @@ match result? with
|
|||
| none =>
|
||||
let process (candidates : List (Name × List String)) : TermElabM (List (Expr × List String)) := do {
|
||||
when candidates.isEmpty $ do {
|
||||
-- TODO: improve pretty printing
|
||||
-- let extractionResult := extractMacroScopes n;
|
||||
-- env ← getEnv;
|
||||
throwError ref ("unknown identifier '" ++ toString n ++ "'")
|
||||
mainModule ← getMainModule;
|
||||
let view := extractMacroScopes n;
|
||||
throwError ref ("unknown identifier '" ++ view.format mainModule ++ "'")
|
||||
};
|
||||
mkConsts ref candidates explicitLevels
|
||||
};
|
||||
|
|
|
|||
|
|
@ -14,6 +14,14 @@ match stx.truncateTrailing.reprint with -- TODO use syntax pretty printer
|
|||
| some str => format str.toFormat
|
||||
| none => format stx
|
||||
|
||||
def MacroScopesView.format (view : MacroScopesView) (mainModule : Name) : Format :=
|
||||
format $
|
||||
if view.scopes.isEmpty then view.name
|
||||
else if view.mainModule == mainModule then
|
||||
view.scopes.foldl mkNameNum (view.name ++ view.imported)
|
||||
else
|
||||
view.scopes.foldl mkNameNum (view.name ++ view.imported ++ view.mainModule)
|
||||
|
||||
namespace Elab
|
||||
|
||||
structure MacroStackElem :=
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue