code cleanup and debugging stuff
This commit is contained in:
parent
a9c1afd5fd
commit
50835257d6
2 changed files with 5 additions and 23 deletions
|
|
@ -199,20 +199,7 @@ proc returnEpc(socket: Socket, uid: BiggestInt, s: SexpNode|string,
|
||||||
let response = $convertSexp([newSSymbol(return_symbol), uid, s])
|
let response = $convertSexp([newSSymbol(return_symbol), uid, s])
|
||||||
socket.send(toHex(len(response), 6))
|
socket.send(toHex(len(response), 6))
|
||||||
socket.send(response)
|
socket.send(response)
|
||||||
|
log "did 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)
|
|
||||||
|
|
||||||
template checkSanity(client, sizeHex, size, messageBuffer: typed) =
|
template checkSanity(client, sizeHex, size, messageBuffer: typed) =
|
||||||
if client.recv(sizeHex, 6) != 6:
|
if client.recv(sizeHex, 6) != 6:
|
||||||
|
|
@ -350,11 +337,6 @@ proc replEpc(x: ThreadParams) {.thread.} =
|
||||||
|
|
||||||
gIdeCmd = parseIdeCmd(message[2].getSymbol)
|
gIdeCmd = parseIdeCmd(message[2].getSymbol)
|
||||||
case gIdeCmd
|
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:
|
of ideSug, ideCon, ideDef, ideUse, ideDus, ideOutline, ideHighlight:
|
||||||
setVerbosity(0)
|
setVerbosity(0)
|
||||||
else: discard
|
else: discard
|
||||||
|
|
|
||||||
|
|
@ -148,7 +148,7 @@ proc sendEpcStr(socket: Socket; cmd: string) =
|
||||||
proc recvEpc(socket: Socket): string =
|
proc recvEpc(socket: Socket): string =
|
||||||
var L = newStringOfCap(6)
|
var L = newStringOfCap(6)
|
||||||
if socket.recv(L, 6) != 6:
|
if socket.recv(L, 6) != 6:
|
||||||
raise newException(ValueError, "recv A failed")
|
raise newException(ValueError, "recv A failed #" & L & "#")
|
||||||
let x = parseHexInt(L)
|
let x = parseHexInt(L)
|
||||||
result = newString(x)
|
result = newString(x)
|
||||||
if socket.recv(result, x) != x:
|
if socket.recv(result, x) != x:
|
||||||
|
|
@ -225,7 +225,7 @@ proc runEpcTest(filename: string): int =
|
||||||
for cmd in s.startup:
|
for cmd in s.startup:
|
||||||
if not runCmd(cmd, s.dest):
|
if not runCmd(cmd, s.dest):
|
||||||
quit "invalid command: " & cmd
|
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)
|
let cl = parseCmdLine(epccmd)
|
||||||
var p = startProcess(command=cl[0], args=cl[1 .. ^1],
|
var p = startProcess(command=cl[0], args=cl[1 .. ^1],
|
||||||
options={poStdErrToStdOut, poUsePath,
|
options={poStdErrToStdOut, poUsePath,
|
||||||
|
|
@ -299,8 +299,8 @@ proc runTest(filename: string): int =
|
||||||
|
|
||||||
proc main() =
|
proc main() =
|
||||||
var failures = 0
|
var failures = 0
|
||||||
when false:
|
when true:
|
||||||
let x = getAppDir() / "tests/tdot1.nim"
|
let x = getAppDir() / "tests/tchk1.nim"
|
||||||
let xx = expandFilename x
|
let xx = expandFilename x
|
||||||
failures += runEpcTest(xx)
|
failures += runEpcTest(xx)
|
||||||
else:
|
else:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue