Skip to content
Browse files

Added stdin/out protocol line prefix to filter those lines.

  • Loading branch information...
1 parent 15595dd commit 2c9c62db7018091a09b1047bf3c26fba296a1b47 @MarcWeber MarcWeber committed with nominolo Jan 20, 2009
Showing with 12 additions and 0 deletions.
  1. +3 −0 server/Scion/Server/ConnectionIO.hs
  2. +9 −0 vim_runtime_path/autoload/haskellcomplete.vim
View
3 server/Scion/Server/ConnectionIO.hs
@@ -40,6 +40,9 @@ instance ConnectionIO (Handle, Handle) where
getN (i,_) = S.hGet i
put (_,o) = S.hPutStr o
putLine (_,o) = \l -> do
+ -- ghc doesn't use the ghc api to print texts all the time. So mark scion replies by a leading "scion:"
+ -- see README.markdown
+ hPutStr o "scion:"
S.hPutStrLn o l
hFlush o -- don't ask me why this is needed. LineBuffering is set as well (!)
View
9 vim_runtime_path/autoload/haskellcomplete.vim
@@ -80,6 +80,15 @@ class ScionServerConnectionStdinOut(ScionServerConnection):
p = Popen([scion_executable,"-i","-f", "/tmp/scion-log"], shell = False, bufsize = 1, stdin = PIPE, stdout = PIPE, stderr = PIPE)
self.scion_o = p.stdout
self.scion_i = p.stdin
+ def receive(self):
+ let s = super.receive()
+ if s[:6] == "scion:":
+ # ghc doesn't always use the ghc API to print statements.. so ignore all
+ # lines not marked by "scion:" at the beginning
+ # see README.markdown
+ return s[6:]
+ else:
+ self.receive()
class ScionServerConnectionSocket(ScionServerConnection):
"""connects to the scion server by either TCP/IP or socketfile"""

0 comments on commit 2c9c62d

Please sign in to comment.
Something went wrong with that request. Please try again.