Skip to content

docs: Add docstrings to ipc_common module #18

Description

@wilcorrea

Summary

CodeRabbit's pre-merge check shows docstring coverage at 33.33%, below the required 80% threshold. The new ipc_common.rs module needs documentation.

Missing Documentation

Need to add docstrings for:

  • Module-level documentation: Explain the purpose of the shared IPC module
  • IpcCommand struct: Document the command structure and available commands
  • IpcResponse struct: Document the response structure
  • process_command() function: Document parameters, return value, and supported commands

Documentation Guidelines

  • Explain the purpose and usage of each item
  • Document the IPC protocol (line-based JSON with IpcCommand → IpcResponse)
  • List supported commands: open, ping, show
  • Explain that this module is shared between Unix socket (ipc.rs) and TCP (tcp_ipc.rs) implementations
  • Document platform compatibility considerations

Example

//! Shared IPC types and command processing logic.
//!
//! This module contains the common data structures and command handling logic
//! used by both Unix socket IPC (`ipc.rs`) and TCP socket IPC (`tcp_ipc.rs`).
//! It ensures consistent behavior across both communication channels.

/// IPC command sent from external processes.
///
/// Supported commands:
/// - `open`: Open a file in the application (requires `path` field)
/// - `ping`: Check if the application is running
/// - `show`: Bring the application window to the foreground
#[derive(Deserialize)]
pub struct IpcCommand {
    /// The command name
    pub command: String,
    /// Optional file path (required for "open" command)
    #[serde(default)]
    pub path: Option<String>,
}

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions