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.
Lets you use LuaLS annotations for E2 functions. This is part of #2759, but is not a complete solution. This only handles annotation and attributes.
Included in this PR is a demo conversion of the
core
extension.Defined annotations:
@cost <value>
- Sets the individual cost of the function@deprecated [message]
- Marks the function as deprecated, with optional message@nodiscard
- Marks the function as nodiscard@noreturn
- Marks the function as noreturnExample usage:
This also supports old attribute style
Limitations include how this doesn't process params, returns, or anything like that. That'll be for a future installment, likely.
You'll also notice this works by piggybacking off of the current preprocessor. This is the simplest solution. Ideally in the future annotation processor would be self-sustained but that requires figuring out #2759. This is more of an intermediary step to ease the transition before such a system comes into place.
The current way attributes were processed had to be modified to fit this system in. Using annotations is the cleaner option now.
I kept in code for descriptions since it may be useful for future reference. The code is functional, it's just useless without an efficient way to transmit.