Skip to content

Commit d319562

Browse files
refactor(Common): Standardize SideCar identifier capitalization
Renamed all occurrences of `SidecarIdentifier` to `SideCarIdentifier` (capitalizing 'Car') to enforce consistent naming across IPC and command execution systems. This change affects: - Command registration/unregistration interfaces in `CommandExecutor` - Debug service provider registration methods - IPC provider trait methods (`SendNotificationToSideCar`, `SendRequestToSideCar`) - Language feature provider registration - Associated ActionEffect constructors and module names Ensures naming alignment throughout Common's abstract core, which defines the contract for Mountain's IPC implementations and Cocoon's RPC handlers. The capitalization change improves readability while maintaining identical functionality for all IPC workflows including command execution, debug sessions, and language features.
1 parent 48d7ce5 commit d319562

12 files changed

+54
-54
lines changed

Source/Command/CommandExecutor.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@ pub trait CommandExecutor: Environment + Send + Sync {
3535
///
3636
/// # Parameters
3737
///
38-
/// * `SidecarIdentifier`: The unique ID of the sidecar where the command
38+
/// * `SideCarIdentifier`: The unique ID of the sidecar where the command
3939
/// logic resides.
4040
/// * `CommandIdentifier`: The unique ID of the command being registered.
41-
async fn RegisterCommand(&self, SidecarIdentifier:String, CommandIdentifier:String) -> Result<(), CommonError>;
41+
async fn RegisterCommand(&self, SideCarIdentifier:String, CommandIdentifier:String) -> Result<(), CommonError>;
4242

4343
/// Unregisters a previously registered command.
44-
async fn UnregisterCommand(&self, SidecarIdentifier:String, CommandIdentifier:String) -> Result<(), CommonError>;
44+
async fn UnregisterCommand(&self, SideCarIdentifier:String, CommandIdentifier:String) -> Result<(), CommonError>;
4545

4646
/// Retrieves a list of all currently registered command identifiers.
4747
async fn GetAllCommands(&self) -> Result<Vec<String>, CommonError>;

Source/Command/RegisterCommand.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use crate::{Effect::ActionEffect::ActionEffect, Error::CommonError::CommonError}
1818
///
1919
/// # Parameters
2020
///
21-
/// * `SidecarIdentifier`: The unique ID of the sidecar where the command logic
21+
/// * `SideCarIdentifier`: The unique ID of the sidecar where the command logic
2222
/// resides.
2323
/// * `CommandIdentifier`: The unique ID of the command itself (e.g.,
2424
@@ -28,15 +28,15 @@ use crate::{Effect::ActionEffect::ActionEffect, Error::CommonError::CommonError}
2828
///
2929
/// An `ActionEffect` that resolves to `()` on success.
3030
pub fn RegisterCommand(
31-
SidecarIdentifier:String,
31+
SideCarIdentifier:String,
3232

3333
CommandIdentifier:String,
3434
) -> ActionEffect<Arc<dyn CommandExecutor>, CommonError, ()> {
3535
ActionEffect::New(Arc::new(move |Executor:Arc<dyn CommandExecutor>| {
36-
let SidecarIdentifierClone = SidecarIdentifier.clone();
36+
let SideCarIdentifierClone = SideCarIdentifier.clone();
3737

3838
let CommandIdentifierClone = CommandIdentifier.clone();
3939

40-
Box::pin(async move { Executor.RegisterCommand(SidecarIdentifierClone, CommandIdentifierClone).await })
40+
Box::pin(async move { Executor.RegisterCommand(SideCarIdentifierClone, CommandIdentifierClone).await })
4141
}))
4242
}

Source/Command/UnregisterCommand.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,23 @@ use crate::{Effect::ActionEffect::ActionEffect, Error::CommonError::CommonError}
1616
///
1717
/// # Parameters
1818
///
19-
/// * `SidecarIdentifier`: The unique ID of the sidecar that originally
19+
/// * `SideCarIdentifier`: The unique ID of the sidecar that originally
2020
/// registered the command.
2121
/// * `CommandIdentifier`: The unique ID of the command to unregister.
2222
///
2323
/// # Returns
2424
///
2525
/// An `ActionEffect` that resolves to `()` on success.
2626
pub fn UnregisterCommand(
27-
SidecarIdentifier:String,
27+
SideCarIdentifier:String,
2828

2929
CommandIdentifier:String,
3030
) -> ActionEffect<Arc<dyn CommandExecutor>, CommonError, ()> {
3131
ActionEffect::New(Arc::new(move |Executor:Arc<dyn CommandExecutor>| {
32-
let SidecarIdentifierClone = SidecarIdentifier.clone();
32+
let SideCarIdentifierClone = SideCarIdentifier.clone();
3333

3434
let CommandIdentifierClone = CommandIdentifier.clone();
3535

36-
Box::pin(async move { Executor.UnregisterCommand(SidecarIdentifierClone, CommandIdentifierClone).await })
36+
Box::pin(async move { Executor.UnregisterCommand(SideCarIdentifierClone, CommandIdentifierClone).await })
3737
}))
3838
}

Source/Debug/DebugService.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ pub trait DebugService: Environment + Send + Sync {
2929
/// * `DebugType`: The type of debugger this provider is for (e.g., "node").
3030
/// * `ProviderHandle`: A unique handle assigned by the extension host for
3131
/// this provider.
32-
/// * `SidecarIdentifier`: The identifier of the sidecar (e.g.,
32+
/// * `SideCarIdentifier`: The identifier of the sidecar (e.g.,
3333
3434
/// "cocoon-main") hosting the provider.
3535
async fn RegisterDebugConfigurationProvider(
@@ -39,7 +39,7 @@ pub trait DebugService: Environment + Send + Sync {
3939

4040
ProviderHandle:u32,
4141

42-
SidecarIdentifier:String,
42+
SideCarIdentifier:String,
4343
) -> Result<(), CommonError>;
4444

4545
/// Registers a factory for creating debug adapter descriptors from an
@@ -49,7 +49,7 @@ pub trait DebugService: Environment + Send + Sync {
4949
/// * `DebugType`: The type of debugger this factory is for.
5050
/// * `FactoryHandle`: A unique handle assigned by the extension host for
5151
/// this factory.
52-
/// * `SidecarIdentifier`: The identifier of the sidecar hosting the
52+
/// * `SideCarIdentifier`: The identifier of the sidecar hosting the
5353
/// factory.
5454
async fn RegisterDebugAdapterDescriptorFactory(
5555
&self,
@@ -58,7 +58,7 @@ pub trait DebugService: Environment + Send + Sync {
5858

5959
FactoryHandle:u32,
6060

61-
SidecarIdentifier:String,
61+
SideCarIdentifier:String,
6262
) -> Result<(), CommonError>;
6363

6464
/// Starts a new debugging session based on a launch configuration.

Source/IPC/EstablishHostConnection.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,25 @@ use std::sync::Arc;
77

88
use serde_json::Value;
99

10-
use super::SendNotificationToSidecar::SendNotificationToSidecar;
10+
use super::SendNotificationToSideCar::SendNotificationToSideCar;
1111
use crate::{Effect::ActionEffect::ActionEffect, Error::CommonError::CommonError, IPC::IPCProvider::IPCProvider};
1212

1313
/// Creates a convenience effect that can be used to perform an initial
1414
/// handshake or ping a sidecar process to confirm connectivity.
1515
///
16-
/// This function is a specialized wrapper around `SendNotificationToSidecar`,
16+
/// This function is a specialized wrapper around `SendNotificationToSideCar`,
1717
1818
/// pre-filling the method name and parameters for a standard handshake
1919
/// notification.
2020
///
2121
/// # Parameters
2222
///
23-
/// * `SidecarIdentifier`: The unique ID of the sidecar process to connect to.
23+
/// * `SideCarIdentifier`: The unique ID of the sidecar process to connect to.
2424
///
2525
/// # Returns
2626
///
2727
/// An `ActionEffect` that resolves to `()` on success and requires the
2828
/// `IPCProvider` capability to be executed.
29-
pub fn EstablishHostConnection(SidecarIdentifier:String) -> ActionEffect<Arc<dyn IPCProvider>, CommonError, ()> {
30-
SendNotificationToSidecar(SidecarIdentifier, "$InitialHandshake".to_string(), Value::Null)
29+
pub fn EstablishHostConnection(SideCarIdentifier:String) -> ActionEffect<Arc<dyn IPCProvider>, CommonError, ()> {
30+
SendNotificationToSideCar(SideCarIdentifier, "$InitialHandshake".to_string(), Value::Null)
3131
}

Source/IPC/IPCProvider.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ pub trait IPCProvider: Environment + Send + Sync {
1919
/// sidecar. This method does not wait for a response.
2020
///
2121
/// # Parameters
22-
/// * `SidecarIdentifier`: The unique ID of the target sidecar process.
22+
/// * `SideCarIdentifier`: The unique ID of the target sidecar process.
2323
/// * `Method`: The name of the notification method to be invoked on the
2424
/// sidecar.
2525
/// * `Parameters`: A `serde_json::Value` containing the parameters for the
2626
/// notification.
27-
async fn SendNotificationToSidecar(
27+
async fn SendNotificationToSideCar(
2828
&self,
2929

30-
SidecarIdentifier:String,
30+
SideCarIdentifier:String,
3131

3232
Method:String,
3333

@@ -37,7 +37,7 @@ pub trait IPCProvider: Environment + Send + Sync {
3737
/// Sends a request to a specified sidecar and awaits a response.
3838
///
3939
/// # Parameters
40-
/// * `SidecarIdentifier`: The unique ID of the target sidecar process.
40+
/// * `SideCarIdentifier`: The unique ID of the target sidecar process.
4141
/// * `Method`: The name of the RPC method to be invoked on the sidecar.
4242
/// * `Parameters`: A `serde_json::Value` containing the parameters for the
4343
/// request.
@@ -47,10 +47,10 @@ pub trait IPCProvider: Environment + Send + Sync {
4747
/// # Returns
4848
/// A `Result` containing the `serde_json::Value` response from the
4949
/// sidecar.
50-
async fn SendRequestToSidecar(
50+
async fn SendRequestToSideCar(
5151
&self,
5252

53-
SidecarIdentifier:String,
53+
SideCarIdentifier:String,
5454

5555
Method:String,
5656

Source/IPC/ProxyCallToSidecar.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//! # ProxyCallToSidecar Effect
1+
//! # ProxyCallToSideCar Effect
22
//!
33
//! Defines the `ActionEffect` for proxying a generic RPC call to a sidecar
44
//! process.
@@ -19,7 +19,7 @@ use crate::{Effect::ActionEffect::ActionEffect, Error::CommonError::CommonError}
1919
///
2020
/// # Parameters
2121
///
22-
/// * `TargetSidecarIdentifier`: The unique ID of the sidecar to which the call
22+
/// * `TargetSideCarIdentifier`: The unique ID of the sidecar to which the call
2323
/// should be proxied.
2424
/// * `CallData`: A JSON `Value` expected to be an object containing `{"Method":
2525
/// "...", "Parameters": ...}`.
@@ -28,13 +28,13 @@ use crate::{Effect::ActionEffect::ActionEffect, Error::CommonError::CommonError}
2828
///
2929
/// An `ActionEffect` that resolves with the JSON `Value` returned by the
3030
/// target sidecar.
31-
pub fn ProxyCallToSidecar(
32-
TargetSidecarIdentifier:String,
31+
pub fn ProxyCallToSideCar(
32+
TargetSideCarIdentifier:String,
3333

3434
CallData:Value,
3535
) -> ActionEffect<Arc<dyn IPCProvider>, CommonError, Value> {
3636
ActionEffect::New(Arc::new(move |Provider:Arc<dyn IPCProvider>| {
37-
let TargetIdentifierClone = TargetSidecarIdentifier.clone();
37+
let TargetIdentifierClone = TargetSideCarIdentifier.clone();
3838

3939
let CallDataClone = CallData.clone();
4040

@@ -58,7 +58,7 @@ pub fn ProxyCallToSidecar(
5858
let DefaultTimeoutMilliseconds = 30000;
5959

6060
Provider
61-
.SendRequestToSidecar(TargetIdentifierClone, MethodString, ParametersValue, DefaultTimeoutMilliseconds)
61+
.SendRequestToSideCar(TargetIdentifierClone, MethodString, ParametersValue, DefaultTimeoutMilliseconds)
6262
.await
6363
})
6464
}))

Source/IPC/SendNotificationToSidecar.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//! # SendNotificationToSidecar Effect
1+
//! # SendNotificationToSideCar Effect
22
//!
33
//! Defines the `ActionEffect` for sending a fire-and-forget notification to a
44
//! sidecar process.
@@ -14,12 +14,12 @@ use crate::{Effect::ActionEffect::ActionEffect, Error::CommonError::CommonError}
1414
/// notification to a specified sidecar process.
1515
///
1616
/// It uses the `IPCProvider` capability from the environment to perform the
17-
/// actual IPC send operation. Unlike `SendRequestToSidecar`, this effect does
17+
/// actual IPC send operation. Unlike `SendRequestToSideCar`, this effect does
1818
/// not wait for or expect a response.
1919
///
2020
/// # Parameters
2121
///
22-
/// * `SidecarIdentifier`: The unique ID of the target sidecar process.
22+
/// * `SideCarIdentifier`: The unique ID of the target sidecar process.
2323
/// * `Method`: The name of the notification method to be invoked on the
2424
/// sidecar.
2525
/// * `Parameters`: A `serde_json::Value` containing the parameters for the
@@ -28,23 +28,23 @@ use crate::{Effect::ActionEffect::ActionEffect, Error::CommonError::CommonError}
2828
/// # Returns
2929
///
3030
/// An `ActionEffect` that resolves to `()` on success.
31-
pub fn SendNotificationToSidecar(
32-
SidecarIdentifier:String,
31+
pub fn SendNotificationToSideCar(
32+
SideCarIdentifier:String,
3333

3434
Method:String,
3535

3636
Parameters:Value,
3737
) -> ActionEffect<Arc<dyn IPCProvider>, CommonError, ()> {
3838
ActionEffect::New(Arc::new(move |Provider:Arc<dyn IPCProvider>| {
39-
let SidecarIdentifierClone = SidecarIdentifier.clone();
39+
let SideCarIdentifierClone = SideCarIdentifier.clone();
4040

4141
let MethodClone = Method.clone();
4242

4343
let ParametersClone = Parameters.clone();
4444

4545
Box::pin(async move {
4646
Provider
47-
.SendNotificationToSidecar(SidecarIdentifierClone, MethodClone, ParametersClone)
47+
.SendNotificationToSideCar(SideCarIdentifierClone, MethodClone, ParametersClone)
4848
.await
4949
})
5050
}))

Source/IPC/SendRequestToSidecar.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//! # SendRequestToSidecar Effect
1+
//! # SendRequestToSideCar Effect
22
//!
33
//! Defines the `ActionEffect` for sending a request-response RPC call to a
44
//! sidecar process.
@@ -18,7 +18,7 @@ use crate::{Effect::ActionEffect::ActionEffect, Error::CommonError::CommonError}
1818
///
1919
/// # Parameters
2020
///
21-
/// * `SidecarIdentifier`: The unique ID of the target sidecar process.
21+
/// * `SideCarIdentifier`: The unique ID of the target sidecar process.
2222
/// * `Method`: The name of the RPC method to be invoked on the sidecar.
2323
/// * `Parameters`: A `serde_json::Value` containing the parameters for the
2424
/// request.
@@ -29,8 +29,8 @@ use crate::{Effect::ActionEffect::ActionEffect, Error::CommonError::CommonError}
2929
///
3030
/// An `ActionEffect` that resolves with the `serde_json::Value` response from
3131
/// the sidecar.
32-
pub fn SendRequestToSidecar(
33-
SidecarIdentifier:String,
32+
pub fn SendRequestToSideCar(
33+
SideCarIdentifier:String,
3434

3535
Method:String,
3636

@@ -39,15 +39,15 @@ pub fn SendRequestToSidecar(
3939
TimeoutMilliseconds:u64,
4040
) -> ActionEffect<Arc<dyn IPCProvider>, CommonError, Value> {
4141
ActionEffect::New(Arc::new(move |Provider:Arc<dyn IPCProvider>| {
42-
let SidecarIdentifierClone = SidecarIdentifier.clone();
42+
let SideCarIdentifierClone = SideCarIdentifier.clone();
4343

4444
let MethodClone = Method.clone();
4545

4646
let ParametersClone = Parameters.clone();
4747

4848
Box::pin(async move {
4949
Provider
50-
.SendRequestToSidecar(SidecarIdentifierClone, MethodClone, ParametersClone, TimeoutMilliseconds)
50+
.SendRequestToSideCar(SideCarIdentifierClone, MethodClone, ParametersClone, TimeoutMilliseconds)
5151
.await
5252
})
5353
}))

Source/IPC/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ pub mod DTO;
1717
// --- Effect Constructors ---
1818
pub mod EstablishHostConnection;
1919

20-
pub mod ProxyCallToSidecar;
20+
pub mod ProxyCallToSideCar;
2121

22-
pub mod SendNotificationToSidecar;
22+
pub mod SendNotificationToSideCar;
2323

24-
pub mod SendRequestToSidecar;
24+
pub mod SendRequestToSideCar;

0 commit comments

Comments
 (0)