IntelliJ-EmmyLua
IntelliJ-EmmyLua copied to clipboard
LDoc is incorrectly parsed
Environment
name | version |
---|---|
IDEA version | 2019.2.2 |
EmmyLua version | 1.3.0.99-IDEA182 |
OS | Arch Linux |
If we are speaking about the same LDoc, then current implementation in this plugin is wrong.
It marks comments as docs only if all lines are started with ---
although only the first one should start with that.
This is ok:
However this does not work, although it should (in LDoc manual scroll to nearest multiline example):
ctrl+q also shows no documentation for the latter case. A big example would be awesome wm.
Also, when you press Backspace after ---
it removes all three characters.
I guess this is intentional, but please at least add a config option to disable that
Sorry, emmylua does not support LDoc
。It's emmy-style doc(EmmyDoc
), all lines must start with ---
, the comment like @xxx
is called annotation
. All annotations are listed here.
Aha, understood
But LDoc is still widely used and if you use a well-documented library that uses LDoc then you cant see all that documentation.
I mean that even partially supporting LDoc should be easy, just allow ---
only to be the first line of the doc comment, LDoc also has annotations and most of them work the same way afaiu.
(Related: https://github.com/EmmyLua/IntelliJ-EmmyLua/issues/75 and https://github.com/EmmyLua/IntelliJ-EmmyLua/issues/222)
I would like to add my vote for LDoc support. LDoc can automatically generate full-fledged documentation from the comments and is widely used.
Another 👍 from me. I found out about EmmyLua in IntelliJ and VS Code and I really, really like it. I would like also to be able to build some documentation using ldoc but with annotations being incompatible I'm stuck with choice between getting code completion or getting docs, sadly I have to choose none.
I'm not heavy Lua user and I don't know anything about IntelliJ details, however I would like to offer my help for example (I guess only testing and providing sample files are the only thing I'm capable for doing for now).
I agree that standard LDoc support would be a valuable improvement, especially because existing linters and documentation renderers all expect LDoc.
Did a little bit of code digging together with @kaklakariada to see if we could contribute to get a little bit more LDoc compatibility. The idea was to support LDocs tparam
and treturn
as synonyms in the parser, because they have the same syntax as EmmyDoc's param
and return
variant mostly.
We found a generated parser in Java and a BNF definition that looks like the origin of that generated code. What we didn't find is the build step that generates the Java code. The result code is checked into the repo, so we are guessing that there is an additional build step that has not been added to the Gradle build scripts. Or we are overlooking it maybe.
Can any of the original authors give us a hint?
@tangzx, could you give us a hint please, where we can see the part of the build that turns the provided BNF into the generated Java?
install idea grammar kit, and right click and select generate parse code. but emmylua perhaps won't choose compatible with LDoc. the emmylua doc has been accepted by many, If you are really interested in this, you can choose to fork this project and publish an independent plugin