diff options
author | Juan M Gómez <info@jmgomez.me> | 2023-12-22 04:38:40 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-22 05:38:40 +0100 |
commit | df3c95d8af7bfd1e61e6b06eec21f57781dff9d5 (patch) | |
tree | c04fc36ad3278cd2080725fb04d51d9bd5550b2a | |
parent | b15463948c6f78a546742fc5c521fa2f6e8f9312 (diff) | |
download | Nim-df3c95d8af7bfd1e61e6b06eec21f57781dff9d5.tar.gz |
makes nimsuggest `con` work under v3 (#23113)
Co-authored-by: Jake Leahy <jake@leahy.dev>
-rw-r--r-- | nimsuggest/nimsuggest.nim | 9 | ||||
-rw-r--r-- | nimsuggest/tests/tv3_con.nim | 13 |
2 files changed, 19 insertions, 3 deletions
diff --git a/nimsuggest/nimsuggest.nim b/nimsuggest/nimsuggest.nim index 03a6e32e1..1d48bf653 100644 --- a/nimsuggest/nimsuggest.nim +++ b/nimsuggest/nimsuggest.nim @@ -984,10 +984,10 @@ proc executeNoHooksV3(cmd: IdeCmd, file: AbsoluteFile, dirtyfile: AbsoluteFile, graph.unmarkAllDirty() # these commands require partially compiled project - elif cmd in {ideSug, ideOutline, ideHighlight, ideDef, ideChkFile, ideType, ideDeclaration, ideExpand} and - (graph.needsCompilation(fileIndex) or cmd == ideSug): + elif cmd in {ideSug, ideCon, ideOutline, ideHighlight, ideDef, ideChkFile, ideType, ideDeclaration, ideExpand} and + (graph.needsCompilation(fileIndex) or cmd in {ideSug, ideCon}): # for ideSug use v2 implementation - if cmd == ideSug: + if cmd in {ideSug, ideCon}: conf.m.trackPos = newLineInfo(fileIndex, line, col) conf.m.trackPosAttached = false else: @@ -1033,6 +1033,9 @@ proc executeNoHooksV3(cmd: IdeCmd, file: AbsoluteFile, dirtyfile: AbsoluteFile, # ideSug performs partial build of the file, thus mark it dirty for the # future calls. graph.markDirtyIfNeeded(file.string, fileIndex) + of ideCon: + graph.markDirty fileIndex + graph.markClientsDirty fileIndex of ideOutline: let n = parseFile(fileIndex, graph.cache, graph.config) graph.iterateOutlineNodes(n, graph.fileSymbols(fileIndex).deduplicateSymInfoPair) diff --git a/nimsuggest/tests/tv3_con.nim b/nimsuggest/tests/tv3_con.nim new file mode 100644 index 000000000..4714c366b --- /dev/null +++ b/nimsuggest/tests/tv3_con.nim @@ -0,0 +1,13 @@ +# tests v3 + +proc test(a: string, b:string) = discard +proc test(a: int) = discard + +test(#[!]# + +discard """ +$nimsuggest --v3 --tester $file +>con $1 +con;;skProc;;tv3_con.test;;proc (a: string, b: string);;$file;;3;;5;;"";;100 +con;;skProc;;tv3_con.test;;proc (a: int);;$file;;4;;5;;"";;100 +""" |