@@ -132,12 +132,13 @@ instance SExpable OutputAnnotation where
132132 BoldText -> "bold"
133133 ItalicText -> "italic"
134134 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))]
136136
137−encodeTerm :: Term -> String
138−encodeTerm = UTF8.toString . Base64.encode . Lazy.toStrict . Binary.encode
137+encodeTerm :: [(Name, Bool)] -> Term -> String
138+encodeTerm bnd tm = UTF8.toString . Base64.encode . Lazy.toStrict . Binary.encode $
139+ (bnd, tm)
139140
140−decodeTerm :: String -> Term
141+decodeTerm :: String -> ([(Name, Bool)], Term)
141142decodeTerm = Binary.decode . Lazy.fromStrict . Base64.decodeLenient . UTF8.fromString
142143
143144instance SExpable FC where
@@ -196,9 +197,9 @@ data IdeSlaveCommand = REPLCompletions String
196197 | Metavariables Int -- ^^ the Int is the column count for pretty-printing
197198 | WhoCalls String
198199 | CallsWho String
199− | TermNormalise Term
200− | TermShowImplicits Term
201− | TermNoImplicits Term
200+ | TermNormalise [(Name, Bool)] Term
201+ | TermShowImplicits [(Name, Bool)] Term
202+ | TermNoImplicits [(Name, Bool)] Term
202203
203204sexpToCommand :: SExp -> Maybe IdeSlaveCommand
204205sexpToCommand (SexpList (x:[])) = sexpToCommand x
@@ -235,9 +236,12 @@ sexpToCommand (SexpList [SymbolAtom "set-option", SymbolAtom s, BoolAtom b])
235236sexpToCommand (SexpList [SymbolAtom "metavariables", IntegerAtom cols]) = Just (Metavariables (fromIntegral cols))
236237sexpToCommand (SexpList [SymbolAtom "who-calls", StringAtom name]) = Just (WhoCalls name)
237238sexpToCommand (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 "show-term-implicits", StringAtom encoded]) = Just (TermShowImplicits (decodeTerm encoded))
240−sexpToCommand (SexpList [SymbolAtom "hide-term-implicits", StringAtom encoded]) = Just (TermNoImplicits (decodeTerm encoded))
239+sexpToCommand (SexpList [SymbolAtom "normalise-term", StringAtom encoded]) = let (bnd, tm) = decodeTerm encoded in
240+ Just (TermNormalise bnd tm)
241+sexpToCommand (SexpList [SymbolAtom "show-term-implicits", StringAtom encoded]) = let (bnd, tm) = decodeTerm encoded in
242+ Just (TermShowImplicits bnd tm)
243+sexpToCommand (SexpList [SymbolAtom "hide-term-implicits", StringAtom encoded]) = let (bnd, tm) = decodeTerm encoded in
244+ Just (TermNoImplicits bnd tm)
241245sexpToCommand _ = Nothing
242246
243247parseMessage :: String -> Either Err (SExp, Integer)