-
-
Notifications
You must be signed in to change notification settings - Fork 215
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ProtoDefinitionHelper.FromDirectory #1263
base: 1.7.x
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 1.7.x #1263 +/- ##
==========================================
+ Coverage 34.94% 39.15% +4.21%
==========================================
Files 201 202 +1
Lines 33266 34146 +880
==========================================
+ Hits 11624 13370 +1746
+ Misses 21087 20235 -852
+ Partials 555 541 -14 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
var modifiedContent = !content.StartsWith(comment) ? $"{comment}\n{content}" : content; | ||
var key = Path.GetFileNameWithoutExtension(filePath); | ||
|
||
dictionary.Add(key, modifiedContent); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm curious why the filename isn't used as the key here. That would make resolving imports work without the comment.
The only change needed is to replace \
with /
of the relative path.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm curious why the filename isn't used as the key here.
The filename is used:var key = Path.GetFileNameWithoutExtension(filePath);
That would make resolving imports work without the comment.
The IProtoFileResolver is used in ProtobufJsonConverterFileSystem.cs which is required by protobuf-net to resolve additional files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From my debugging, it tries to resolve based on the import filename, which would match the key in the dictionary based on the relative file path, no?
No description provided.