mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-31 02:12:11 +00:00
makes nimsuggest con work under v3 [Backport_1.6.18] (#23158)
Co-authored-by: Jake Leahy <jake@leahy.dev>
This commit is contained in:
@@ -957,10 +957,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:
|
||||
@@ -1006,6 +1006,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)
|
||||
|
||||
13
nimsuggest/tests/tv3_con.nim
Normal file
13
nimsuggest/tests/tv3_con.nim
Normal file
@@ -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
|
||||
"""
|
||||
Reference in New Issue
Block a user