-
Notifications
You must be signed in to change notification settings - Fork 23
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
Implement @external
tag for External Types
#143
Implement @external
tag for External Types
#143
Conversation
I'm not sure this matches the original vision for the |
@evaera If you could find some time to share more on the original vision for the |
Just what's specified in the issue, it's pretty simple. No need for |
The dependency on the |
Excellent work, thank you. I noticed that we have a "don't do this" warning for defining multiple external types with the same name. Would it be possible to simply make this error instead? I believe we already error if you define multiple classes of the same name. Also, does it work when you define an external type by itself in a doc comment? Like: --[=[
@external test example.com
]=] ..with no other class, function, type, etc. associated. I didn't see an example like this in the tests. |
Just tested it, external types by themselves in a doc comment like your example will fail, expecting an explicit kind tag. Do you expect this to work? Currently external types are stored on doc entries as a vector called I also just tested having multiple classes of the same name, it doesn't error for me. I can implement something though to support warning for both classes and external tags if they have the same name. |
I think that erroring if there are name conflicts makes the most sense, since it’s invalid and is likely a mistake. We have other errors for things that are invalid (I guess not for multiple classes of the same name though, but we probably should have had that to begin with). And yeah, I think it would be useful for those to work without having to be attached to a doc entry of another kind. I think we have an issue open for being able to put multiple doc comments in one comment. So that would be separate work, but would allow you to put multiple external tags in one block. For now, I think having external tags be their own kind of doc comment is best |
Added functionality for erroring on name conflicts with any tag we specify, I just set it to |
Looks good! |
Resolves #8
This implements a simple
@external <name> <url>
tag for linking to External Types.In this implementation,
@external
is a tag which can be defined in any doc comment, and then used in any doc comment.The
url
argument simply links to any external documentation page, e.g. https://eryn.io/roblox-lua-promise/api/Promise.Notable Changes
all_tags
was updated to include the usage of the external type. A new passing testexternal_types
was added to test the new external tag.@class
and@external
tag are now reported as an error.Example