Skip to content

Commit fac39a9

Browse files
committed
fix when parentModule not found
1 parent 6235d8f commit fac39a9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

compiler/tools/suggest.nim

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,9 @@ proc executeCmd*(cmd: IdeCmd, file, dirtyfile: AbsoluteFile, line, col: int;
492492
dirtyfile.isEmpty:
493493
discard "no need to recompile anything"
494494
else:
495-
let modIdx = graph.parentModule(dirtyIdx)
495+
var modIdx = graph.parentModule(dirtyIdx)
496+
if modIdx == FileIndex(0):
497+
modIdx = dirtyIdx
496498
graph.markDirty dirtyIdx
497499
graph.markClientsDirty dirtyIdx
498500
# partially recompiling the project means that that VM and JIT state

0 commit comments

Comments
 (0)