Skip to content

Commit dbc6944

Browse files
committed
docs(ide): drop CCB references from code comments
Code comments should describe the protocol / behavior itself, not name the upstream project. External references belong in docs/ markdown.
1 parent 2fbf08c commit dbc6944

5 files changed

Lines changed: 14 additions & 25 deletions

File tree

crates/core/src/ide.rs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,12 @@
1414
//!
1515
//! ## Wire schema alignment
1616
//!
17-
//! Field names mirror CCB's `selection_changed` MCP notification payload
18-
//! (see `claude-code-best/src/hooks/useIdeSelection.ts`). This keeps the
19-
//! deserializer trivial and preserves the "opened file but nothing
20-
//! selected" semantics: `line_count == 0 && file_path.is_some()`.
17+
//! Field names mirror the upstream `selection_changed` MCP notification
18+
//! payload so the deserializer is trivial, and preserve the "opened file
19+
//! but nothing selected" semantics: `line_count == 0 && file_path.is_some()`.
2120
//!
22-
//! The injection template in `crab-ide` also mirrors CCB's prose to
23-
//! keep LLM prompt patterns familiar.
21+
//! The injection template in `crab-ide` also mirrors the upstream prose
22+
//! to keep LLM prompt patterns familiar.
2423
2524
use serde::{Deserialize, Serialize};
2625
use std::path::PathBuf;
@@ -148,8 +147,8 @@ mod tests {
148147
}
149148

150149
#[test]
151-
fn selection_parses_ccb_wire_format() {
152-
// Shape matches `selection_changed` notification params from CCB.
150+
fn selection_parses_mcp_wire_format() {
151+
// Shape matches the upstream `selection_changed` MCP notification params.
153152
let json = r#"{
154153
"line_count": 11,
155154
"line_start": 10,

crates/ide/src/injection.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22
//! `<system-reminder>` meta-user messages for LLM context.
33
//!
44
//! Called by `crab-agent` right before sending a user prompt. The
5-
//! output string (wrapped by the caller) follows CCB's template
6-
//! verbatim (`messages.ts:3648-3662`) so LLMs trained against
7-
//! Claude Code's prompt patterns recognize the shape.
5+
//! output string (wrapped by the caller) follows the upstream template
6+
//! so LLMs trained against that prompt pattern recognize the shape.
87
98
#![allow(dead_code)] // R1 scaffolding; wired into agent in R3
109

@@ -15,8 +14,7 @@ use std::path::Path;
1514
///
1615
/// Returns `None` when there is nothing to inject (no selection or
1716
/// missing fields). Caller wraps it in `<system-reminder>...</system-reminder>`
18-
/// and pushes as a `user`-role meta message, mirroring CCB's
19-
/// `wrapMessagesInSystemReminder` + `isMeta: true` behavior.
17+
/// and pushes as a `user`-role meta message.
2018
pub fn build_selected_lines_reminder(sel: &IdeSelection, _cwd: &Path) -> Option<String> {
2119
if !sel.has_text() {
2220
return None;

crates/ide/src/lockfile.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! Discovery of IDE plugin MCP endpoints via lockfile.
22
//!
3-
//! CCB's plugin writes `~/.claude/ide/<port>.lock` on startup with a
4-
//! JSON payload describing how to reach the MCP server:
3+
//! IDE plugins write `<ide-dir>/<port>.lock` on startup with a JSON
4+
//! payload describing how to reach their MCP server:
55
//!
66
//! ```json
77
//! {
@@ -16,10 +16,8 @@
1616
//! Filename = port (e.g. `12345.lock` ⇒ MCP server listens on `12345`).
1717
//!
1818
//! Search paths (checked in order):
19-
//! 1. `~/.claude/ide/*.lock` — CCB's official plugin (piggyback path)
19+
//! 1. `~/.claude/ide/*.lock` — upstream plugin's directory (piggyback path)
2020
//! 2. `~/.crab/ide/*.lock` — our future plugin (self-hosted path)
21-
//!
22-
//! Reference: `claude-code-best/src/utils/ide.ts:295-393`
2321
2422
#![allow(dead_code)] // R1 scaffolding; wired up in R2
2523

crates/ide/src/notifications.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
11
//! MCP notification handlers.
22
//!
33
//! Registers handlers on the MCP client for the two IDE-specific
4-
//! notifications CCB's plugin sends:
4+
//! notifications IDE plugins send:
55
//!
66
//! - `selection_changed` — ambient state; updates `handles.selection`.
77
//! - `at_mentioned` — one-shot; fanned out via a broadcast channel.
8-
//!
9-
//! Wire schemas come from:
10-
//! `claude-code-best/src/hooks/useIdeSelection.ts:32-53`
11-
//! `claude-code-best/src/hooks/useIdeAtMentioned.ts:18-26`
128
139
#![allow(dead_code)] // R1 scaffolding; wired up in R2
1410

crates/ide/src/quirks/wsl.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
//! `/home/user/project`. This module will translate between them so
66
//! `IdeSelection::file_path` remains useful regardless of where the
77
//! crab process is running.
8-
//!
9-
//! Reference: `claude-code-best/src/utils/idePathConversion.ts`
108
119
#![allow(dead_code)] // R1 scaffolding; wired up in R3
1210

0 commit comments

Comments
 (0)