Skip to content
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

Add Javadoc on generated Psi interfaces #204

Open
oowekyala opened this issue Nov 22, 2018 · 1 comment
Open

Add Javadoc on generated Psi interfaces #204

oowekyala opened this issue Nov 22, 2018 · 1 comment
Labels

Comments

@oowekyala
Copy link

Many thanks for the great work on this plugin!

Something irks me slightly though: I find I constantly have to refer directly to the BNF file to find out the structure of a node. Maybe there's another way to do that I'm not aware of (?), but for me what would really help is to add a javadoc comment on the generated psi interfaces.

The generated parser already has a doc comment on every method, which describes the form of the production, eg. here:

https://github.com/JetBrains/intellij-sdk-docs/blob/69edc8f403b1ab4d7a7b7a7c8155f3567228b76d/code_samples/simple_language_plugin/gen/com/simpleplugin/parser/SimpleParser.java#L93-L94

Having a javadoc comment featuring the same kind of info would be nice. Token references would link to the IElementType constant if it's generated too, production references would link to the relevant Psi interface.

I imagine if it was on a public production (eg if simpleFile was public), the comment // (property|COMMENT)* would be rendered as the following Javadoc:

/**
 * <pre>
 *   simpleFile ::= ({@linkplain SimpleProperty property} | {@linkplain SimpleTypes.COMMENT COMMENT})*
 * </pre>
 */
public interface SimpleFile { // ... 

(modulo imports). Maybe even adding an attribute to add a header line to the javadoc could be helpful too.

I'm not aware of an existing way to do this. If this is already possible then sorry for the noise.

@oowekyala oowekyala changed the title Add doc on generate Psi interfaces Add Javadoc on generated Psi interfaces Nov 22, 2018
@gregsh
Copy link
Collaborator

gregsh commented Nov 23, 2018

Thanks for a good suggestion. I'll try to find some time for that in the new update.

@gregsh gregsh added the Feature label Dec 31, 2020
@gregsh gregsh pinned this issue Dec 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants