make nimsuggest compile again

This commit is contained in:
Andreas Rumpf 2018-05-14 13:04:18 +02:00
commit 1616c6e029

View file

@ -195,7 +195,7 @@ proc execute(cmd: IdeCmd, file, dirtyfile: string, line, col: int;
if conf.ideCmd in {ideUse, ideDus}: if conf.ideCmd in {ideUse, ideDus}:
let u = if suggestVersion != 1: graph.symFromInfo(gTrackPos) else: graph.usageSym let u = if suggestVersion != 1: graph.symFromInfo(gTrackPos) else: graph.usageSym
if u != nil: if u != nil:
listUsages(u) listUsages(conf, u)
else: else:
localError(conf, gTrackPos, "found no symbol at this position " & $gTrackPos) localError(conf, gTrackPos, "found no symbol at this position " & $gTrackPos)
@ -385,10 +385,10 @@ proc execCmd(cmd: string; graph: ModuleGraph; cache: IdentCache; cachedMsgs: Cac
results.send(Suggest(section: ideNone)) results.send(Suggest(section: ideNone))
template toggle(sw) = template toggle(sw) =
if sw in gGlobalOptions: if sw in conf.globalOptions:
excl(gGlobalOptions, sw) excl(conf.globalOptions, sw)
else: else:
incl(gGlobalOptions, sw) incl(conf.globalOptions, sw)
sentinel() sentinel()
return return
@ -490,8 +490,8 @@ proc mainCommand(graph: ModuleGraph; cache: IdentCache) =
clearPasses() clearPasses()
registerPass verbosePass registerPass verbosePass
registerPass semPass registerPass semPass
gCmd = cmdIdeTools conf.cmd = cmdIdeTools
incl gGlobalOptions, optCaasEnabled incl conf.globalOptions, optCaasEnabled
wantMainModule(conf) wantMainModule(conf)
if not fileExists(conf.projectFull): if not fileExists(conf.projectFull):
@ -546,15 +546,15 @@ proc processCmdLine*(pass: TCmdLinePass, cmd: string; conf: ConfigRef) =
of "cmdsug": of "cmdsug":
gMode = mcmdsug gMode = mcmdsug
gAddress = p.val gAddress = p.val
incl(gGlobalOptions, optIdeDebug) incl(conf.globalOptions, optIdeDebug)
of "cmdcon": of "cmdcon":
gMode = mcmdcon gMode = mcmdcon
gAddress = p.val gAddress = p.val
incl(gGlobalOptions, optIdeDebug) incl(conf.globalOptions, optIdeDebug)
of "epc": of "epc":
gMode = mepc gMode = mepc
gVerbosity = 0 # Port number gotta be first. conf.verbosity = 0 # Port number gotta be first.
of "debug": incl(gGlobalOptions, optIdeDebug) of "debug": incl(conf.globalOptions, optIdeDebug)
of "v2": suggestVersion = 0 of "v2": suggestVersion = 0
of "v1": suggestVersion = 1 of "v1": suggestVersion = 1
of "tester": of "tester":