summary refs log tree commit diff stats
path: root/compiler/renderer.nim
diff options
context:
space:
mode:
authorJake Leahy <jake@leahy.dev>2022-12-16 02:05:34 +1100
committerGitHub <noreply@github.com>2022-12-15 16:05:34 +0100
commitd88f46df388604c1d21a2a95482c3255dc5884b6 (patch)
tree9a2999198949ef6f1b5782067cfd3c4431b0cb2c /compiler/renderer.nim
parent91ce8c385d4ccbaab8048cf0393b01cd72282272 (diff)
downloadNim-d88f46df388604c1d21a2a95482c3255dc5884b6.tar.gz
Make async stacktraces less verbose (#21091)
* Name iterators something human readable

Remove intermediate async procs from stacktraces

Clean async traceback message from reraises message

* Remove unused import/variable

* Fix failing tests

Don't add {.stackTrace: off.} to anonymous procs (They already don't appear in stacktrace)

* Fix failing tests in pragma category

Now check that the nim is a routine type first so we don't run into any assertion defects

* Hide stack trace pragma in docs and update doc tests

User doesn't need to know if something won't appear so this more becomes verbose noise

If this is a bad idea we can always add a `when defined(nimdoc)` switch so we don't add {.stackTrace: off.} to the Future[T] returning proc for docs
Diffstat (limited to 'compiler/renderer.nim')
-rw-r--r--compiler/renderer.nim4
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/renderer.nim b/compiler/renderer.nim
index ad74cf2fe..cd0d83eb0 100644
--- a/compiler/renderer.nim
+++ b/compiler/renderer.nim
@@ -619,7 +619,9 @@ proc isHideable(config: ConfigRef, n: PNode): bool =
   # xxx compare `ident` directly with `getIdent(cache, wRaises)`, but
   # this requires a `cache`.
   case n.kind
-  of nkExprColonExpr: result = n[0].kind == nkIdent and n[0].ident.s in ["raises", "tags", "extern", "deprecated", "forbids"]
+  of nkExprColonExpr:
+    result = n[0].kind == nkIdent and
+             n[0].ident.s.nimIdentNormalize in ["raises", "tags", "extern", "deprecated", "forbids", "stacktrace"]
   of nkIdent: result = n.ident.s in ["gcsafe", "deprecated"]
   else: result = false