nimsuggest: do not execute the .nims file when requested to auto-complete it
This commit is contained in:
parent
7e835a84b8
commit
a0b547001b
1 changed files with 3 additions and 3 deletions
|
|
@ -608,9 +608,9 @@ proc handleCmdLine(cache: IdentCache; config: ConfigRef) =
|
||||||
options.command = "nimsuggest"
|
options.command = "nimsuggest"
|
||||||
let scriptFile = gProjectFull.changeFileExt("nims")
|
let scriptFile = gProjectFull.changeFileExt("nims")
|
||||||
if fileExists(scriptFile):
|
if fileExists(scriptFile):
|
||||||
runNimScript(cache, scriptFile, freshDefines=false, config)
|
# 'nimsuggest foo.nims' means to just auto-complete the NimScript file:
|
||||||
# 'nim foo.nims' means to just run the NimScript file and do nothing more:
|
if scriptFile != gProjectFull:
|
||||||
if scriptFile == gProjectFull: return
|
runNimScript(cache, scriptFile, freshDefines=false, config)
|
||||||
elif fileExists(gProjectPath / "config.nims"):
|
elif fileExists(gProjectPath / "config.nims"):
|
||||||
# directory wide NimScript file
|
# directory wide NimScript file
|
||||||
runNimScript(cache, gProjectPath / "config.nims", freshDefines=false, config)
|
runNimScript(cache, gProjectPath / "config.nims", freshDefines=false, config)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue