src/Tools/VSCode/src/protocol.scala
changeset 65095 eb21a4f70b0e
parent 65094 386d9d487f62
child 65103 0bf1836ce4b1
equal deleted inserted replaced
65094:386d9d487f62 65095:eb21a4f70b0e
   405   }
   405   }
   406 
   406 
   407 
   407 
   408   /* decorations */
   408   /* decorations */
   409 
   409 
       
   410   object Decorations
       
   411   {
       
   412     val bad = "bad"
       
   413   }
       
   414 
   410   sealed case class DecorationOptions(range: Line.Range, hover_message: List[MarkedString])
   415   sealed case class DecorationOptions(range: Line.Range, hover_message: List[MarkedString])
   411   {
   416   {
   412     def json: JSON.T =
   417     def json: JSON.T =
   413       Map("range" -> Range(range)) ++
   418       Map("range" -> Range(range)) ++
   414       JSON.optional("hoverMessage" ->
   419       JSON.optional("hoverMessage" ->
   415         (if (hover_message.isEmpty) None else Some(hover_message.map(_.json))))
   420         (if (hover_message.isEmpty) None else Some(hover_message.map(_.json))))
   416   }
   421   }
   417 
   422 
   418   object Decoration
   423   sealed case class Decoration(typ: String, content: List[DecorationOptions])
   419   {
   424   {
   420     def apply(file: JFile, typ: String, content: List[DecorationOptions]): JSON.T =
   425     def json(file: JFile): JSON.T =
   421       Notification("PIDE/decoration",
   426       Notification("PIDE/decoration",
   422         Map("uri" -> Url.print_file(file), "type" -> typ, "content" -> content.map(_.json)))
   427         Map("uri" -> Url.print_file(file), "type" -> typ, "content" -> content.map(_.json)))
   423   }
   428   }
   424 }
   429 }