commit
c0201b8d4a
4 changed files with 4 additions and 3 deletions
|
|
@ -559,6 +559,7 @@ proc MainCommand =
|
||||||
wantMainModule()
|
wantMainModule()
|
||||||
CommandSuggest()
|
CommandSuggest()
|
||||||
of "serve":
|
of "serve":
|
||||||
|
isServing = true
|
||||||
gGlobalOptions.incl(optCaasEnabled)
|
gGlobalOptions.incl(optCaasEnabled)
|
||||||
msgs.gErrorMax = high(int) # do not stop after first error
|
msgs.gErrorMax = high(int) # do not stop after first error
|
||||||
serve(MainCommand)
|
serve(MainCommand)
|
||||||
|
|
|
||||||
|
|
@ -523,8 +523,8 @@ proc SuggestWriteln*(s: string) =
|
||||||
stdoutSocket.send(s & "\c\L")
|
stdoutSocket.send(s & "\c\L")
|
||||||
|
|
||||||
proc SuggestQuit*() =
|
proc SuggestQuit*() =
|
||||||
if isNil(stdoutSocket): quit(0)
|
if not isServing: quit(0)
|
||||||
else:
|
elif not isNil(stdoutSocket):
|
||||||
stdoutSocket.send("\c\L")
|
stdoutSocket.send("\c\L")
|
||||||
raise newException(ESuggestDone, "suggest done")
|
raise newException(ESuggestDone, "suggest done")
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -105,6 +105,7 @@ var
|
||||||
gEvalExpr* = "" # expression for idetools --eval
|
gEvalExpr* = "" # expression for idetools --eval
|
||||||
gLastCmdTime*: float # when caas is enabled, we measure each command
|
gLastCmdTime*: float # when caas is enabled, we measure each command
|
||||||
gListFullPaths*: bool
|
gListFullPaths*: bool
|
||||||
|
isServing*: bool = false
|
||||||
|
|
||||||
proc importantComments*(): bool {.inline.} = gCmd in {cmdDoc, cmdIdeTools}
|
proc importantComments*(): bool {.inline.} = gCmd in {cmdDoc, cmdIdeTools}
|
||||||
proc usesNativeGC*(): bool {.inline.} = gSelectedGC >= gcRefc
|
proc usesNativeGC*(): bool {.inline.} = gSelectedGC >= gcRefc
|
||||||
|
|
|
||||||
|
|
@ -90,4 +90,3 @@ proc serve*(action: proc (){.nimcall.}) =
|
||||||
else:
|
else:
|
||||||
echo "Invalid server.type:", typ
|
echo "Invalid server.type:", typ
|
||||||
quit 1
|
quit 1
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue