summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2017-03-03 10:19:49 +0100
committerAndreas Rumpf <rumpf_a@web.de>2017-03-03 10:19:49 +0100
commit50835257d6febac8d137fa8980e7db278f8321ac (patch)
tree452342dc7a54882d91e6338ab811b7c8ea8c1097
parenta9c1afd5fd9d0055c849c10bea5dfe7494398cfd (diff)
downloadNim-50835257d6febac8d137fa8980e7db278f8321ac.tar.gz
code cleanup and debugging stuff
-rw-r--r--tools/nimsuggest/nimsuggest.nim20
-rw-r--r--tools/nimsuggest/tester.nim8
2 files changed, 5 insertions, 23 deletions
diff --git a/tools/nimsuggest/nimsuggest.nim b/tools/nimsuggest/nimsuggest.nim
index 97c46625c..1c67ddcee 100644
--- a/tools/nimsuggest/nimsuggest.nim
+++ b/tools/nimsuggest/nimsuggest.nim
@@ -199,20 +199,7 @@ proc returnEpc(socket: Socket, uid: BiggestInt, s: SexpNode|string,
   let response = $convertSexp([newSSymbol(return_symbol), uid, s])
   socket.send(toHex(len(response), 6))
   socket.send(response)
-
-template sendEpc(results: typed, tdef, hook: untyped) =
-  hook = proc (s: tdef) =
-    results.add(
-      # Put newlines to parse output by flycheck-nim.el
-      when results is string: s & "\n"
-      else: s
-    )
-
-  executeEpc(gIdeCmd, args, graph, cache)
-  let res = sexp(results)
-  if gLogging:
-    log($res)
-  returnEpc(client, uid, res)
+  log "did send " & response
 
 template checkSanity(client, sizeHex, size, messageBuffer: typed) =
   if client.recv(sizeHex, 6) != 6:
@@ -350,11 +337,6 @@ proc replEpc(x: ThreadParams) {.thread.} =
 
       gIdeCmd = parseIdeCmd(message[2].getSymbol)
       case gIdeCmd
-      of ideChk:
-        setVerbosity(1)
-        # Use full path because other emacs plugins depends it
-        gListFullPaths = true
-        incl(gGlobalOptions, optIdeDebug)
       of ideSug, ideCon, ideDef, ideUse, ideDus, ideOutline, ideHighlight:
         setVerbosity(0)
       else: discard
diff --git a/tools/nimsuggest/tester.nim b/tools/nimsuggest/tester.nim
index a80c0b3d7..732056c8d 100644
--- a/tools/nimsuggest/tester.nim
+++ b/tools/nimsuggest/tester.nim
@@ -148,7 +148,7 @@ proc sendEpcStr(socket: Socket; cmd: string) =
 proc recvEpc(socket: Socket): string =
   var L = newStringOfCap(6)
   if socket.recv(L, 6) != 6:
-    raise newException(ValueError, "recv A failed")
+    raise newException(ValueError, "recv A failed #" & L & "#")
   let x = parseHexInt(L)
   result = newString(x)
   if socket.recv(result, x) != x:
@@ -225,7 +225,7 @@ proc runEpcTest(filename: string): int =
   for cmd in s.startup:
     if not runCmd(cmd, s.dest):
       quit "invalid command: " & cmd
-  let epccmd = s.cmd.replace("--tester", "--epc --v2")
+  let epccmd = s.cmd.replace("--tester", "--epc --v2 --log")
   let cl = parseCmdLine(epccmd)
   var p = startProcess(command=cl[0], args=cl[1 .. ^1],
                        options={poStdErrToStdOut, poUsePath,
@@ -299,8 +299,8 @@ proc runTest(filename: string): int =
 
 proc main() =
   var failures = 0
-  when false:
-    let x = getAppDir() / "tests/tdot1.nim"
+  when true:
+    let x = getAppDir() / "tests/tchk1.nim"
     let xx = expandFilename x
     failures += runEpcTest(xx)
   else: