diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2017-03-10 13:20:32 +0100 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2017-03-10 13:20:32 +0100 |
commit | c5566f7c375edeb0768753e27ef4c2ad5011b2a5 (patch) | |
tree | 61ba05150b78993d8fe66eafcc44ecb3df5c0c11 | |
parent | 68181e6da2ee22ad3411cd55f1c8b04df3d375cb (diff) | |
download | Nim-c5566f7c375edeb0768753e27ef4c2ad5011b2a5.tar.gz |
nimsuggest: make 'con' work again
-rw-r--r-- | compiler/lexer.nim | 4 | ||||
-rw-r--r-- | nimsuggest/tests/tcon1.nim | 13 |
2 files changed, 17 insertions, 0 deletions
diff --git a/compiler/lexer.nim b/compiler/lexer.nim index b2c2a7877..2bb228f41 100644 --- a/compiler/lexer.nim +++ b/compiler/lexer.nim @@ -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) diff --git a/nimsuggest/tests/tcon1.nim b/nimsuggest/tests/tcon1.nim new file mode 100644 index 000000000..262dd5151 --- /dev/null +++ b/nimsuggest/tests/tcon1.nim @@ -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 +""" |