@@ -132,12 +132,13 @@ instance SExpable OutputAnnotation where
132 BoldText -> "bold"
132 BoldText -> "bold"
133 ItalicText -> "italic"
133 ItalicText -> "italic"
134 UnderlineText -> "underline"
134 UnderlineText -> "underline"
135− toSExp (AnnTerm tm) = toSExp [(SymbolAtom "tt-term", StringAtom (encodeTerm tm))]
135+ toSExp (AnnTerm bnd tm) = toSExp [(SymbolAtom "tt-term", StringAtom (encodeTerm bnd tm))]
137−encodeTerm :: Term -> String
137+encodeTerm :: [(Name, Bool)] -> Term -> String
138−encodeTerm = UTF8.toString . Base64.encode . Lazy.toStrict . Binary.encode
138+encodeTerm bnd tm = UTF8.toString . Base64.encode . Lazy.toStrict . Binary.encode $
140−decodeTerm :: String -> Term
141+decodeTerm :: String -> ([(Name, Bool)], Term)
141decodeTerm = Binary.decode . Lazy.fromStrict . Base64.decodeLenient . UTF8.fromString
142decodeTerm = Binary.decode . Lazy.fromStrict . Base64.decodeLenient . UTF8.fromString
143instance SExpable FC where
144instance SExpable FC where
@@ -196,9 +197,9 @@ data IdeSlaveCommand = REPLCompletions String
196 | Metavariables Int -- ^^ the Int is the column count for pretty-printing
197 | Metavariables Int -- ^^ the Int is the column count for pretty-printing
197 | WhoCalls String
198 | WhoCalls String
198 | CallsWho String
199 | CallsWho String
199− | TermNormalise Term
200+ | TermNormalise [(Name, Bool)] Term
200− | TermShowImplicits Term
201+ | TermShowImplicits [(Name, Bool)] Term
201− | TermNoImplicits Term
202+ | TermNoImplicits [(Name, Bool)] Term
203sexpToCommand :: SExp -> Maybe IdeSlaveCommand
204sexpToCommand :: SExp -> Maybe IdeSlaveCommand
204sexpToCommand (SexpList (x:[])) = sexpToCommand x
205sexpToCommand (SexpList (x:[])) = sexpToCommand x
@@ -235,9 +236,12 @@ sexpToCommand (SexpList [SymbolAtom "set-option", SymbolAtom s, BoolAtom b])
235sexpToCommand (SexpList [SymbolAtom "metavariables", IntegerAtom cols]) = Just (Metavariables (fromIntegral cols))
236sexpToCommand (SexpList [SymbolAtom "metavariables", IntegerAtom cols]) = Just (Metavariables (fromIntegral cols))
236sexpToCommand (SexpList [SymbolAtom "who-calls", StringAtom name]) = Just (WhoCalls name)
237sexpToCommand (SexpList [SymbolAtom "who-calls", StringAtom name]) = Just (WhoCalls name)
237sexpToCommand (SexpList [SymbolAtom "calls-who", StringAtom name]) = Just (CallsWho name)
238sexpToCommand (SexpList [SymbolAtom "calls-who", StringAtom name]) = Just (CallsWho name)
238−sexpToCommand (SexpList [SymbolAtom "normalise-term", StringAtom encoded]) = Just (TermNormalise (decodeTerm encoded))
239+sexpToCommand (SexpList [SymbolAtom "normalise-term", StringAtom encoded]) = let (bnd, tm) = decodeTerm encoded in
240+ Just (TermNormalise bnd tm)
239−sexpToCommand (SexpList [SymbolAtom "show-term-implicits", StringAtom encoded]) = Just (TermShowImplicits (decodeTerm encoded))
241+sexpToCommand (SexpList [SymbolAtom "show-term-implicits", StringAtom encoded]) = let (bnd, tm) = decodeTerm encoded in
242+ Just (TermShowImplicits bnd tm)
240−sexpToCommand (SexpList [SymbolAtom "hide-term-implicits", StringAtom encoded]) = Just (TermNoImplicits (decodeTerm encoded))
243+sexpToCommand (SexpList [SymbolAtom "hide-term-implicits", StringAtom encoded]) = let (bnd, tm) = decodeTerm encoded in
244+ Just (TermNoImplicits bnd tm)
241sexpToCommand _ = Nothing
245sexpToCommand _ = Nothing
243parseMessage :: String -> Either Err (SExp, Integer)
247parseMessage :: String -> Either Err (SExp, Integer)