From fac39a9ee059238085f454f56539a8fc1ee596b9 Mon Sep 17 00:00:00 2001 From: bung87 Date: Wed, 11 Oct 2023 15:15:31 +0800 Subject: [PATCH] fix when parentModule not found --- compiler/tools/suggest.nim | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/compiler/tools/suggest.nim b/compiler/tools/suggest.nim index 3c097ae60cf..f6ed9aaa8f2 100644 --- a/compiler/tools/suggest.nim +++ b/compiler/tools/suggest.nim @@ -492,7 +492,9 @@ proc executeCmd*(cmd: IdeCmd, file, dirtyfile: AbsoluteFile, line, col: int; dirtyfile.isEmpty: discard "no need to recompile anything" else: - let modIdx = graph.parentModule(dirtyIdx) + var modIdx = graph.parentModule(dirtyIdx) + if modIdx == FileIndex(0): + modIdx = dirtyIdx graph.markDirty dirtyIdx graph.markClientsDirty dirtyIdx # partially recompiling the project means that that VM and JIT state