Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions crates/ecp-analyzer/src/protobuf/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//! Protobuf `.proto` file analysis — T4-5 schema-field detector.
//! Protobuf `.proto` file analysis — message structs, schema fields, and
//! gRPC service contracts.
//!
//! Uses a hand-rolled line-oriented lexer (Option B) because no
//! `tree-sitter-protobuf` crate exists in the workspace. The lexer handles
Expand All @@ -11,12 +12,20 @@
//! }
//! ```
//!
//! Each top-level `message` with ≥1 field becomes a `NodeKind::Struct`
//! (value-type aggregate — no inheritance/vtable, distinct from `Class`),
//! owning its fields via `HasProperty`. Without this owner node the schema
//! fields are dropped at `schema_field_mirrors` and never reach the graph.
//!
//! **Acknowledged limitations (v1)**:
//! - Nested `message` definitions are skipped (parser does not recurse).
//! - `oneof` blocks are not supported — fields inside them are not emitted.
//! - `map<K,V>` fields are not supported — skipped with no emission.
//! - `enum` definitions are ignored (no `SchemaField` equivalent).
//! - RPC / service blocks are ignored.
//! - `service { rpc … }` blocks ARE captured: each `rpc` becomes a
//! `NodeKind::Route` (method `GRPC`, path `/<package.>Service/Method`) so
//! gRPC service contracts are visible to `ecp routes` / `ecp contracts`.
//! Nested services and rpc request/response message types are not captured.
//! - Multi-line comments (`/* … */`) are treated as opaque — a field
//! declaration whose line falls inside a block comment may be emitted.
//! Single-line `//` comments are stripped correctly.
Expand Down
Loading
Loading