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