Add supported endpoint types to predicates#3331
Merged
Conversation
73221e8 to
bcd251d
Compare
bcd251d to
0b4c611
Compare
shati-patel
approved these changes
Feb 12, 2024
Contributor
shati-patel
left a comment
There was a problem hiding this comment.
As mentioned inline, I can't really comment on the ruby specifics, but the code/comments seem fine generally! Up to you if you'd like a more comprehensive review, otherwise LGTM 🙇🏽♀️
Comment on lines
+75
to
+89
| export function rubyEndpointType(typeName: string, methodName: string) { | ||
| if (typeName.endsWith("!") && methodName === "new") { | ||
| // This is a constructor | ||
| return EndpointType.Constructor; | ||
| } | ||
|
|
||
| if (typeName.endsWith("!") && methodName === "") { | ||
| return EndpointType.Module; | ||
| } | ||
|
|
||
| if (methodName === "") { | ||
| return EndpointType.Class; | ||
| } | ||
|
|
||
| return EndpointType.Method; |
Contributor
There was a problem hiding this comment.
I don't know enough about ruby to comment on the conditions here, but it seems sensible!
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.
This adds the possibility for languages to define which predicates are supported for each endpoint type. It also defines a method for languages to define the endpoint type of an endpoint, overriding the default heuristics.
For Ruby, we are making the following changes to support of models:
This is based on the examples shown here.
Checklist
ready-for-doc-reviewlabel there.