nimsuggest: make 'con' work again

This commit is contained in:
Andreas Rumpf
2017-03-10 13:20:32 +01:00
parent 68181e6da2
commit c5566f7c37
2 changed files with 17 additions and 0 deletions

View File

@@ -1061,6 +1061,10 @@ proc rawGetTok*(L: var TLexer, tok: var TToken) =
inc(L.bufpos)
else:
tok.tokType = tkParLe
when defined(nimsuggest):
if L.fileIdx == gTrackPos.fileIndex and tok.col < gTrackPos.col and
tok.line == gTrackPos.line and gIdeCmd == ideCon:
gTrackPos.col = tok.col.int16
of ')':
tok.tokType = tkParRi
inc(L.bufpos)

View File

@@ -0,0 +1,13 @@
proc test(s: string; a: int) = discard
proc testB(a, b: string) = discard
test("hello here", #[!]#)
testB(#[!]#
discard """
$nimsuggest --tester $file
>con $1
con;;skProc;;tcon1.test;;proc (s: string, a: int);;$file;;1;;5;;"";;100
>con $2
con;;skProc;;tcon1.testB;;proc (a: string, b: string);;$file;;2;;5;;"";;100
"""