-
-
Notifications
You must be signed in to change notification settings - Fork 61
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
Neogen sync/update [feature request] #65
Comments
This will not work because it'll override the annotation |
Hmm it seems difficult to implement, as how we could retrieve easily the annotation and see if it has been changed Do you have any ideas ? Maybe with some regex |
Really what's needed is a treesitter grammar for the annotations themselves-- so it would be a feature that relatively few languages support, but IMO definitely worth it for popular ones. I could implement this for Python google-style docstrings. |
You mean creating a grammar for annotations ? That could work indeed, but as of right now, we don't have any. |
you could retrieve the old annotation, create the new one, compare the "fields", see where values are set, set the im the new annotation -> profit :) |
the problem is: how do you know something is the old annotation ? That's why having a parser for annotations could be a huge benefit, but I don't think it's something easily feasible |
you just get the comment about the function and check if it's kinda like the annotations format e.g. |
Even though, this check is not sufficient, take a look: --- this is not meant to be an annotation
function test()
end If we allow this type of behavior, this will mean that everything on top of the function, that has |
hmmm |
One way to handle this, would be to keep the Information about created annotation (with marks) |
For reference, it seems like this is possible with bare |
It would be a great feature, but I think it is not that easy to implement. To implement this, a better way is to parse the generated comments before, and then we can do a sync, which means additional parser should be implemented. A special mark could be a quick (but dirty) way... |
Sometimes the source material for a generated annotation might be changed after the annotation has been generated. In these cases, it would be very useful to have a command (
neogen.sync()
?) to update an existing annotation. For example:Run
neogen.generate()
:But now suppose I add type annotations so the top line reads:
Then the hypothetical
neogen.sync()
would do this:The text was updated successfully, but these errors were encountered: