feat: add Protobuf language support (tree-sitter Niveau 1) - #175
Open
flupkede wants to merge 1 commit into
Open
Conversation
Add .proto as a first-class text-indexable language via the tree-sitter-proto 0.4.0 grammar, mirroring the existing per-language pattern.
- Cargo.toml: tree-sitter-proto = "0.4.0"
- src/file/language.rs: Language::Protobuf variant + from_extension("proto") + from_name("protobuf"|"proto") + supports_tree_sitter + name()
- src/chunker/grammar.rs: load_grammar arm (tree_sitter_proto::LANGUAGE.into()) + supported_languages
- src/chunker/extractor.rs: ProtobufExtractor (definition_types: message/enum/service/rpc; names read from the *_name child nodes since proto grammar has no name field; classify message->Struct/enum->Enum/service->Interface/rpc->Method) + get_extractor arm
Tests: .proto detection, proto grammar load, is_supported, get_extractor, protobuf definition_types. All 1220 lib/bin tests pass.
This is Niveau 1 (text-aware chunking aligned to message/service/enum boundaries). Niveau 2 (SCIP symbols -> find_impact/call-graph) is deliberately deferred: no scip-protobuf emitter exists and there is no current .proto corpus to justify it. See GitHub #162.
flupkede
force-pushed
the
feat/protobuf-language-support
branch
from
July 29, 2026 22:15
5d66ac2 to
be61891
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add
.protoas a first-class text-indexable language (Niveau 1), implementing the cheap half of GitHub #162.What
tree-sitter-proto = "0.4.0"grammar dependency.Language::Protobufenum variant wired through the full per-language pipeline:from_extension("proto"),from_name("protobuf"|"proto"),supports_tree_sitter(),name().grammar.rs:load_grammarreturnstree_sitter_proto::LANGUAGE.into()(+ added tosupported_languages).extractor.rs: newProtobufExtractor— chunks.protofiles aligned tomessage/enum/service/rpcdefinition boundaries instead of naive line-windowing. Names are read from the grammar's dedicatedmessage_name/enum_name/service_name/rpc_namechild nodes (proto grammar has nonamefield).Why Niveau 1 only
Text-aware chunking makes
.protosearchable with syntax awareness (definitions as chunk boundaries, named, classified). Niveau 2 (SCIP symbol index →find_impact/call-graph) is deferred: there is noscip-protobufemitter and no current.protocorpus in any indexed repo to justify the work. Adding language support is harmless/costless — see #162 discussion.Validation
cargo fmt --check,cargo check --all-targets,cargo clippy -D warnings,cargo test --lib --bins(1220 passed, 0 failed). Includes new tests: proto detection, proto grammar load, is_supported, get_extractor, protobuf definition_types.Closes nothing yet (#162 left open — Niveau 2 / motivating use-case still pending).