mirror of
https://github.com/nim-lang/Nim.git
synced 2026-06-04 19:04:46 +00:00
nimsuggest: do not execute the .nims file when requested to auto-complete it
This commit is contained in:
@@ -608,9 +608,9 @@ proc handleCmdLine(cache: IdentCache; config: ConfigRef) =
|
||||
options.command = "nimsuggest"
|
||||
let scriptFile = gProjectFull.changeFileExt("nims")
|
||||
if fileExists(scriptFile):
|
||||
runNimScript(cache, scriptFile, freshDefines=false, config)
|
||||
# 'nim foo.nims' means to just run the NimScript file and do nothing more:
|
||||
if scriptFile == gProjectFull: return
|
||||
# 'nimsuggest foo.nims' means to just auto-complete the NimScript file:
|
||||
if scriptFile != gProjectFull:
|
||||
runNimScript(cache, scriptFile, freshDefines=false, config)
|
||||
elif fileExists(gProjectPath / "config.nims"):
|
||||
# directory wide NimScript file
|
||||
runNimScript(cache, gProjectPath / "config.nims", freshDefines=false, config)
|
||||
|
||||
Reference in New Issue
Block a user