@@ -98,6 +98,17 @@ pub struct Range {
9898 pub end : Position
9999}
100100
101+ /// Source information for preview content
102+ #[ derive( Clone , Debug , Serialize , Deserialize , PartialEq ) ]
103+ pub struct PreviewSource {
104+ /// The type of source that opened the preview
105+ #[ serde( rename = "type" ) ]
106+ pub preview_source_type : PreviewSourceType ,
107+
108+ /// The ID of the source (session_id or terminal process ID)
109+ pub id : String
110+ }
111+
101112/// Possible values for Kind in OpenEditor
102113#[ derive( Clone , Debug , Serialize , Deserialize , PartialEq , strum_macros:: Display , strum_macros:: EnumString ) ]
103114pub enum OpenEditorKind {
@@ -110,6 +121,34 @@ pub enum OpenEditorKind {
110121 Uri
111122}
112123
124+ /// Possible values for Destination in ShowHtmlFile
125+ #[ derive( Clone , Debug , Serialize , Deserialize , PartialEq , strum_macros:: Display , strum_macros:: EnumString ) ]
126+ pub enum ShowHtmlFileDestination {
127+ #[ serde( rename = "plot" ) ]
128+ #[ strum( to_string = "plot" ) ]
129+ Plot ,
130+
131+ #[ serde( rename = "viewer" ) ]
132+ #[ strum( to_string = "viewer" ) ]
133+ Viewer ,
134+
135+ #[ serde( rename = "editor" ) ]
136+ #[ strum( to_string = "editor" ) ]
137+ Editor
138+ }
139+
140+ /// Possible values for Type in PreviewSource
141+ #[ derive( Clone , Debug , Serialize , Deserialize , PartialEq , strum_macros:: Display , strum_macros:: EnumString ) ]
142+ pub enum PreviewSourceType {
143+ #[ serde( rename = "runtime" ) ]
144+ #[ strum( to_string = "runtime" ) ]
145+ Runtime ,
146+
147+ #[ serde( rename = "terminal" ) ]
148+ #[ strum( to_string = "terminal" ) ]
149+ Terminal
150+ }
151+
113152/// Parameters for the DidChangePlotsRenderSettings method.
114153#[ derive( Clone , Debug , Serialize , Deserialize , PartialEq ) ]
115154pub struct DidChangePlotsRenderSettingsParams {
@@ -305,6 +344,9 @@ pub struct ModifyEditorSelectionsParams {
305344pub struct ShowUrlParams {
306345 /// The URL to display
307346 pub url : String ,
347+
348+ /// Optional source information for the URL
349+ pub source : Option < PreviewSource > ,
308350}
309351
310352/// Parameters for the ShowHtmlFile method.
@@ -317,8 +359,9 @@ pub struct ShowHtmlFileParams {
317359 /// superseded by the title in the HTML file.
318360 pub title : String ,
319361
320- /// Whether the HTML file is a plot-like object
321- pub is_plot : bool ,
362+ /// Where the file should be shown in Positron: as an interactive plot, in
363+ /// the viewer pane, or in a new editor tab.
364+ pub destination : ShowHtmlFileDestination ,
322365
323366 /// The desired height of the HTML viewer, in pixels. The special value 0
324367 /// indicates that no particular height is desired, and -1 indicates that
0 commit comments