Implement package ID inheritance and cross-package type resolution - #93
Merged
Conversation
Co-authored-by: rijesha <7819200+rijesha@users.noreply.github.com>
Co-authored-by: rijesha <7819200+rijesha@users.noreply.github.com>
Co-authored-by: rijesha <7819200+rijesha@users.noreply.github.com>
Co-authored-by: rijesha <7819200+rijesha@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Update pkg import code for proto files
Implement package ID inheritance and cross-package type resolution
Dec 18, 2025
Contributor
|
@copilot |
Co-authored-by: rijesha <7819200+rijesha@users.noreply.github.com>
Contributor
Author
Fixed in commit f475af5. The packaging test now runs automatically as part of test_all and appears in the "PACKAGE IMPORT TESTS" section of the output.
Fixed in commit f475af5. Added |
rijesha
marked this pull request as ready for review
December 18, 2025 18:53
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.
Proto files can now import other proto files without explicit package IDs - imported packages inherit the ID from their importer. Cross-package type references are now supported with automatic namespace resolution.
Core Changes
option pkgidinherit from importing packagepackage_importsdict tracks import relationships;Field.type_packagetracks type originsCode Generation
.protogenerates own.sf.{h,hpp,ts,py,cs}regardless of import relationshipsusingdirectives for imported packages; uses correct package names for cross-package typesExample
Generated C#:
Test Files
pkg_test_messages.proto: pkgid=1, importscommon_types.proto(inherits ID) andpkg_test_a.proto(pkgid=2)test_packaging.py: Validates inheritance and cross-package referencestest_config.jsonto include packaging teststest_packaging.pywhentest_allis calledOriginal prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.