summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2015-05-25 00:48:28 +0200
committerAndreas Rumpf <rumpf_a@web.de>2015-05-25 00:48:28 +0200
commitcea13e4b5ad3525f458a21eebbc4565fd7dafbc0 (patch)
tree47f8ec9c9a4fef007ced8508ceecc00e3ceb523d
parent6c8f7cc481f508ac3873d5c5529e67d60c61b8ee (diff)
parent4cc722a41420e24f53a3a66be08e3b4a41b76d69 (diff)
downloadNim-cea13e4b5ad3525f458a21eebbc4565fd7dafbc0.tar.gz
Merge pull request #2784 from reactormonk/nimsuggest-works-on-first-try
Nimsuggest works on first try
-rw-r--r--compiler/nimsuggest/nimsuggest.nim8
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler/nimsuggest/nimsuggest.nim b/compiler/nimsuggest/nimsuggest.nim
index 3b4aa658d..2c785d118 100644
--- a/compiler/nimsuggest/nimsuggest.nim
+++ b/compiler/nimsuggest/nimsuggest.nim
@@ -119,9 +119,8 @@ proc execute(cmd: IdeCmd, file, dirtyfile: string, line, col: int) =
   gTrackPos = newLineInfo(dirtyIdx, line, col)
   gErrorCounter = 0
   if not isKnownFile:
-    compileProject(dirtyIdx)
-  else:
     compileProject()
+  compileProject(dirtyIdx)
 
 proc executeEPC(cmd: IdeCmd, args: SexpNode) =
   let
@@ -192,8 +191,6 @@ proc parseCmdLine(cmd: string) =
   execute(gIdeCmd, orig, dirtyfile, line, col-1)
 
 proc serve() =
-  # do not stop after the first error:
-  msgs.gErrorMax = high(int)
   case gMode:
   of mstdin:
     echo Help
@@ -278,6 +275,9 @@ proc mainCommand =
     # current path is always looked first for modules
     prependStr(searchPaths, gProjectPath)
 
+  # do not stop after the first error:
+  msgs.gErrorMax = high(int)
+  compileProject()
   serve()
 
 proc processCmdLine*(pass: TCmdLinePass, cmd: string) =