Skip to content
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

Allow TypeProvider to iterate over message fields #377

Open
JimLarson opened this issue Jul 10, 2020 · 0 comments
Open

Allow TypeProvider to iterate over message fields #377

JimLarson opened this issue Jul 10, 2020 · 0 comments
Assignees
Labels

Comments

@JimLarson
Copy link
Collaborator

@JimLarson JimLarson commented Jul 10, 2020

Feature request checklist

  • There are no issues that match the desired change
  • The change is large enough it can't be addressed with a simple Pull Request
  • If this is a bug, please file a Bug Report.

Change
There is currently no way in the TypeProvider interface to discover the fields available in a message.

Example

for _, field := range provider.MessageFields(msgName) {
        fieldType, found := provider.FindFieldType(msgName, field)
        ...do something with field...
}

Alternatives considered
Could use proto reflection if you have an instance about, but won't work for a compiler server where foreign proto definitions are imported by FileDescriptorSet.

@JimLarson JimLarson self-assigned this Jul 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.