summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorMiran <narimiran@disroot.org>2019-04-24 14:12:16 +0200
committerAndreas Rumpf <rumpf_a@web.de>2019-04-24 14:12:16 +0200
commit25e3e6db8e94e3b311e719be347537a0965e194f (patch)
tree5351fd7138d9cdfaecb535d43f857d4cdfa14d70 /compiler
parent1ddb496b6d7bb34b77b4b114efd8aa9b1783a1bc (diff)
downloadNim-25e3e6db8e94e3b311e719be347537a0965e194f.tar.gz
docgen: generate docs for modules imported in system.nim, fixes #10972 (#11101)
Diffstat (limited to 'compiler')
-rw-r--r--compiler/docgen2.nim4
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/docgen2.nim b/compiler/docgen2.nim
index 2232601f4..048860423 100644
--- a/compiler/docgen2.nim
+++ b/compiler/docgen2.nim
@@ -20,11 +20,12 @@ type
   TGen = object of PPassContext
     doc: PDoc
     module: PSym
+    config: ConfigRef
   PGen = ref TGen
 
 template shouldProcess(g): bool =
   (g.module.owner.id == g.doc.conf.mainPackageId and optWholeProject in g.doc.conf.globalOptions) or
-      sfMainModule in g.module.flags
+      sfMainModule in g.module.flags or g.config.projectMainIdx == g.module.info.fileIndex
 
 template closeImpl(body: untyped) {.dirty.} =
   var g = PGen(p)
@@ -60,6 +61,7 @@ template myOpenImpl(ext: untyped) {.dirty.} =
   var g: PGen
   new(g)
   g.module = module
+  g.config = graph.config
   var d = newDocumentor(AbsoluteFile toFullPath(graph.config, FileIndex module.position),
       graph.cache, graph.config, ext)
   d.hasToc = true