| Summary: | No Doxygen template comments for extern "C" void myFunc(int param) | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [Tools] CDT | Reporter: | Axel Mueller <aegges> | ||||||||||
| Component: | cdt-editor | Assignee: | Anton Leherbauer <aleherb+eclipse> | ||||||||||
| Status: | RESOLVED FIXED | QA Contact: | Anton Leherbauer <aleherb+eclipse> | ||||||||||
| Severity: | normal | ||||||||||||
| Priority: | P3 | CC: | malaperle | ||||||||||
| Version: | 7.0 | ||||||||||||
| Target Milestone: | 8.0 | ||||||||||||
| Hardware: | PC | ||||||||||||
| OS: | All | ||||||||||||
| Whiteboard: | |||||||||||||
| Attachments: |
|
||||||||||||
|
Description
Axel Mueller
Created attachment 177490 [details]
Generate documentation for extern function declaration
This patch will allow the documentation to be generated above the extern if only one declaration is present in the extern (ICPPASTLinkageSpecification). If more than one declarations are present in the extern, the documentation should be above each declarations anyway.
(In reply to comment #1) > This patch will allow the documentation to be generated above the extern if > only one declaration is present in the extern (ICPPASTLinkageSpecification). If > more than one declarations are present in the extern, the documentation should > be above each declarations anyway. In case of extern "C" { void myFunc(int param); } I get the doxygen comment also above the extern "C". It's a minor issue, though, and fixing might not be trivial as the AST does not differentiate between these two variants, AFAIK. Created attachment 177758 [details]
Generate documentation for extern function declaration
I made a new patch using the raw string and node offsets. I'm not too sure about this solution.
Hi Anton. What to you think of this new patch? Should I try something else? (In reply to comment #4) > Hi Anton. What to you think of this new patch? Should I try something else? You could try using IASTNode.getTrailingSyntax / IASTNode.getLeadingSyntax. This provides a way to look "between" nodes. Created attachment 178535 [details]
Generate documentation for extern function declaration
Thanks for the suggestion. This new patch make use of getTrailingSyntax.
(In reply to comment #6) > Thanks for the suggestion. This new patch make use of getTrailingSyntax. Looks much better. Two minor things: - Don't log the exceptions from getTrailingsyntax() I think it would also be safer to just return without trying to change the document in this case. - Use token.getType() == IToken.tRBRACE Created attachment 178961 [details] Generate documentation for extern function declaration (In reply to comment #7) > Looks much better. Two minor things: > - Don't log the exceptions from getTrailingsyntax() > I think it would also be safer to just return without trying to change the > document in this case. > - Use token.getType() == IToken.tRBRACE Thanks! Here's the new patch. Thanks, I committed the patch to HEAD and also added a few JUnit tests. *** cdt cvs genie on behalf of aleherbau *** Bug 323561 - No Doxygen template comments for extern "C" void myFunc(int param) Patch from Marc-Andre Laperle [*] DoxygenMultilineAutoEditStrategy.java 1.12 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt-core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/text/doctools/doxygen/DoxygenMultilineAutoEditStrategy.java?root=Tools_Project&r1=1.11&r2=1.12 [*] DoxygenCCommentAutoEditStrategyTest.java 1.7 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt-core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/doctools/doxygen/DoxygenCCommentAutoEditStrategyTest.java?root=Tools_Project&r1=1.6&r2=1.7 |