forked from 1b-agent/opencadstudio-upstream
feat(plugins): expose document path to plugins via HostApi
OpenCADStudio/plugins#901 (comment) - Add HostApi::document_path(tab_id) returning Option<PathBuf>. - Add PluginRequest::DocumentPath and PluginResponse::DocumentPath for out-of-process plugins. - Implement the request in the IPC server and in both V3/V4 plugin-side HostApi proxies. - Implement HostSession::document_path by looking up the tab by id and returning its current_path.
This commit is contained in:
1 parent
3024869de0
commit
09ba67bfd1
6 files changed
+58
No files matched your search
@@ -136,6 +136,8 @@ pub enum PluginRequest {
|
||||
CloseDocumentViewV4 { tab_id: u64 },
|
||||
/// V4: ask the host for the stable tab identifier of the active tab.
|
||||
GetTabId,
|
||||
/// V4: ask the host for the filesystem path of the document in `tab_id`.
|
||||
DocumentPath { tab_id: u64 },
|
||||
}
|
||||
|
||||
/// Responses the host sends back for `PluginRequest`.
|
||||
@@ -160,6 +162,8 @@ pub enum PluginResponse {
|
||||
},
|
||||
/// V4: stable tab identifier of the active tab.
|
||||
TabId(u64),
|
||||
/// V4: filesystem path of the document in the requested tab, if any.
|
||||
DocumentPath(Option<String>),
|
||||
}
|
||||
|
||||
/// Messages sent from the host to the plugin runner.
|
||||
|
||||
Reference in new issue
Block a user