djinni icon indicating copy to clipboard operation
djinni copied to clipboard

trailing comments

Open skabbes opened this issue 10 years ago • 5 comments

When using djinni, it fails on trailing comments. Using comments not for documentation, but for commenting out methods / fields doesn't really work.

Works (because it still looks like a documentation comment)

blah = interface +c {
    # method_a();
    method_b();
}

Doesn't work but I would guess every single developer would expect it to

blah = interface +c {
    method_a();
    # method_b();
}

skabbes avatar Jan 30 '15 05:01 skabbes

Maybe there should be a special token to indicate documentation comments. Something like starting a comment block with double ## in the spirit of javadoc/doxygen to distinguish them from passive comments.

mknejp avatar Feb 05 '15 01:02 mknejp

We're looking at this same sort of use case internally, and I agree there needs to be a distinction between doc comments and code comments. Our current thought is to avoid compatibility-breakages by adding a second comment syntax using // (C++ style) for code comments, leaving # reserved for doc comments. Thoughts?

artwyman avatar May 14 '15 20:05 artwyman

I need to generate comments so that they can be parsed by another tool. To maintain backwards compatibility I vote on using // for code comments. I can even try to create a PR with this if you agree with this change.

4brunu avatar Jun 14 '18 10:06 4brunu

I'm in favor of that option, as I said above, so I'd say go for it.

artwyman avatar Jun 15 '18 01:06 artwyman

I created the PR https://github.com/dropbox/djinni/pull/379 which implements code comments support.

4brunu avatar Jun 20 '18 12:06 4brunu