Add support for annotating lua model files #3
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.
Hi @leafo,
Is there interest in supporting lapis projects which do not use Moonscript?
I have re-written this since the last PR, and thanks to the refactoring, it's now quite simple. :)
I was able to successfully use this for the following PR in our lapis app.
https://github.com/snap-cloud/snapCloud/pull/355/files#diff-536051a826b3ce1fdc058ac7368426038abf2f72a096067103c1ed7e82665ee0
I opted to be a little flexible with the declaration syntax or the model class
local %w+ = Model:extendto insert the annotations. (I was going to strictly follow camelCase, but ran into one case where our variable name didn't exactly match thecamelizefunction.) Of course, the does require you use local variables and not renameModel, but I think those are acceptable compromises.I will re-add the docs if you think this is helpful.
Thanks!