nimsuggest supports include files properly; added the compiler itself as a testcase

This commit is contained in:
Andreas Rumpf 2016-11-06 11:19:59 +01:00
commit 0c49822b50
4 changed files with 29 additions and 7 deletions

View file

@ -157,13 +157,11 @@ proc execute(cmd: IdeCmd, file, dirtyfile: string, line, col: int;
dirtyfile.len == 0:
discard "no need to recompile anything"
else:
#resetModule dirtyIdx
#if dirtyIdx != gProjectMainIdx:
# resetModule gProjectMainIdx
graph.markDirty dirtyIdx
graph.markClientsDirty dirtyIdx
let modIdx = graph.parentModule(dirtyIdx)
graph.markDirty modIdx
graph.markClientsDirty modIdx
if gIdeCmd != ideMod:
graph.compileProject(cache, dirtyIdx)
graph.compileProject(cache, modIdx)
if gIdeCmd in {ideUse, ideDus}:
let u = if suggestVersion >= 2: graph.symFromInfo(gTrackPos) else: usageSym
if u != nil:

View file

@ -0,0 +1,7 @@
discard """
$nimsuggest --tester compiler/nim.nim
>def compiler/semexprs.nim:13:50
def;;skType;;ast.PSym;;PSym;;*ast.nim;;668;;2;;"";;100
>def compiler/semexprs.nim:13:50
def;;skType;;ast.PSym;;PSym;;*ast.nim;;668;;2;;"";;100
"""