Skip to content

Commit

Permalink
rpc: serialize user message styles
Browse files Browse the repository at this point in the history
Signed-off-by: Ali Caglayan <alizter@gmail.com>
  • Loading branch information
Alizter committed Aug 26, 2023
1 parent fdc7f1a commit e5ccd20
Show file tree
Hide file tree
Showing 11 changed files with 949 additions and 131 deletions.
2 changes: 2 additions & 0 deletions otherlibs/dune-rpc/dune_rpc.ml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ module V1 = struct
module Message = Message
module Where = Where
module Registry = Registry
module Ansi_color = Ansi_color
module User_message = User_message
include Public

module Client = struct
Expand Down
76 changes: 76 additions & 0 deletions otherlibs/dune-rpc/dune_rpc.mli
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,80 @@ module V1 : sig
val to_string_absolute : t -> string
end

module Ansi_color : sig
module RGB8 : sig
type t
end

module RGB24 : sig
type t
end

module Style : sig
type t =
| Fg_default
| Fg_black
| Fg_red
| Fg_green
| Fg_yellow
| Fg_blue
| Fg_magenta
| Fg_cyan
| Fg_white
| Fg_bright_black
| Fg_bright_red
| Fg_bright_green
| Fg_bright_yellow
| Fg_bright_blue
| Fg_bright_magenta
| Fg_bright_cyan
| Fg_bright_white
| Fg_8_bit_color of RGB8.t
| Fg_24_bit_color of RGB24.t
| Bg_default
| Bg_black
| Bg_red
| Bg_green
| Bg_yellow
| Bg_blue
| Bg_magenta
| Bg_cyan
| Bg_white
| Bg_bright_black
| Bg_bright_red
| Bg_bright_green
| Bg_bright_yellow
| Bg_bright_blue
| Bg_bright_magenta
| Bg_bright_cyan
| Bg_bright_white
| Bg_8_bit_color of RGB8.t
| Bg_24_bit_color of RGB24.t
| Bold
| Dim
| Italic
| Underline
end
end

module User_message : sig
module Style : sig
type t =
| Loc
| Error
| Warning
| Kwd
| Id
| Prompt
| Hint
| Details
| Ok
| Debug
| Success
| Ansi_styles of Ansi_color.Style.t list
end
end

module Target : sig
type t =
| Path of string
Expand Down Expand Up @@ -121,6 +195,7 @@ module V1 : sig

val loc : t -> Loc.t
val message : t -> unit Pp.t
val message_with_style : t -> User_message.Style.t Pp.t
end

type t
Expand All @@ -129,6 +204,7 @@ module V1 : sig
val loc : t -> Loc.t option
val id : t -> Id.t
val message : t -> unit Pp.t
val message_with_style : t -> User_message.Style.t Pp.t
val severity : t -> severity option
val promotion : t -> Promotion.t list

Expand Down
Loading

0 comments on commit e5ccd20

Please sign in to comment.