Include plugin name with AddStatusItem RPC#725
Conversation
cmyr
left a comment
There was a problem hiding this comment.
The usual nits.
This also needs an update to the documentation, and now that we've merged the xi-mac PR we can update the API there as well. 😄
| use serde_json::{self, Value}; | ||
| use xi_rpc::{self, RpcPeer}; | ||
|
|
||
| use tabs::ViewId; |
There was a problem hiding this comment.
Is this from rustfmt or something? Normally we don't include braces on a single-item import.
| } | ||
|
|
||
| pub fn add_status_item(&self, view_id: ViewId, key: &str, value: &str, alignment: &str) { | ||
| pub fn add_status_item(&self, view_id: ViewId, plugin: &str, key: &str, value: &str, alignment: &str) { |
There was a problem hiding this comment.
I was thinking about this a bit more, and I think instead of calling this plugin we should call it source. I think it's likely that core will end up using this API, so we should be more general.
| self.view_id, &key, &value, &alignment), | ||
| AddStatusItem { key, value, alignment } => { | ||
| let plugin_name = &self.plugins.iter().find(|p| p.id == plugin).unwrap().name; | ||
| self.client.add_status_item( |
There was a problem hiding this comment.
Formatting here is a bit messed up.
| @@ -384,6 +384,8 @@ this writing, the following is valid json for a `Command` object: | |||
|
|
|||
There was a problem hiding this comment.
the signature for the method needs to be updated as well.
| @@ -0,0 +1 @@ | |||
| 2. Press v and move the cursor to the fifth item below. Notice that the | |||
06369b4 to
0fa9e39
Compare
|
@nangtrongvuon can you take another pass over this, and then I'll take a look? |
This PR makes adding the status item include the plugin name from which it originates, so that client can manage items that come from the same plugin.
companion to xi-mac #210