mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-04 06:45:43 +02:00
Bug 240558 - Doxygen comment generator doesn't recognize void parameter properly
This commit is contained in:
parent
03871352b5
commit
9551d8a724
2 changed files with 55 additions and 3 deletions
|
@ -10,7 +10,6 @@
|
||||||
* Sergey Prigogin, Google
|
* Sergey Prigogin, Google
|
||||||
* Andrew Ferguson (Symbian)
|
* Andrew Ferguson (Symbian)
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.cdt.ui.tests.text.doctools.doxygen;
|
package org.eclipse.cdt.ui.tests.text.doctools.doxygen;
|
||||||
|
|
||||||
import junit.framework.Test;
|
import junit.framework.Test;
|
||||||
|
@ -617,6 +616,58 @@ public class DoxygenCCommentAutoEditStrategyTest extends DefaultCCommentAutoEdit
|
||||||
assertAutoEditBehaviour();
|
assertAutoEditBehaviour();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// class Test {
|
||||||
|
// public:
|
||||||
|
// /**X
|
||||||
|
// Test();
|
||||||
|
// };
|
||||||
|
|
||||||
|
// class Test {
|
||||||
|
// public:
|
||||||
|
// /**
|
||||||
|
// * X
|
||||||
|
// */
|
||||||
|
// Test();
|
||||||
|
// };
|
||||||
|
public void testAutoDocCommentConstructor1() throws CoreException {
|
||||||
|
assertAutoEditBehaviour();
|
||||||
|
}
|
||||||
|
|
||||||
|
// class Test {
|
||||||
|
// public:
|
||||||
|
// /**X
|
||||||
|
// Test(int x);
|
||||||
|
// };
|
||||||
|
|
||||||
|
// class Test {
|
||||||
|
// public:
|
||||||
|
// /**
|
||||||
|
// * X
|
||||||
|
// * @param x
|
||||||
|
// */
|
||||||
|
// Test(int x);
|
||||||
|
// };
|
||||||
|
public void testAutoDocCommentConstructor2() throws CoreException {
|
||||||
|
assertAutoEditBehaviour();
|
||||||
|
}
|
||||||
|
|
||||||
|
// class Test {
|
||||||
|
// public:
|
||||||
|
// /**X
|
||||||
|
// ~Test();
|
||||||
|
// };
|
||||||
|
|
||||||
|
// class Test {
|
||||||
|
// public:
|
||||||
|
// /**
|
||||||
|
// * X
|
||||||
|
// */
|
||||||
|
// ~Test();
|
||||||
|
// };
|
||||||
|
public void testAutoDocCommentDestructor() throws CoreException {
|
||||||
|
assertAutoEditBehaviour();
|
||||||
|
}
|
||||||
|
|
||||||
protected void assertAutoEditBehaviour() throws CoreException {
|
protected void assertAutoEditBehaviour() throws CoreException {
|
||||||
CTextTools textTools = CUIPlugin.getDefault().getTextTools();
|
CTextTools textTools = CUIPlugin.getDefault().getTextTools();
|
||||||
final IDocument doc = new Document();
|
final IDocument doc = new Document();
|
||||||
|
|
|
@ -27,6 +27,7 @@ import org.eclipse.cdt.core.dom.ast.IASTDeclSpecifier;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTDeclaration;
|
import org.eclipse.cdt.core.dom.ast.IASTDeclaration;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTDeclarator;
|
import org.eclipse.cdt.core.dom.ast.IASTDeclarator;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTEnumerationSpecifier;
|
import org.eclipse.cdt.core.dom.ast.IASTEnumerationSpecifier;
|
||||||
|
import org.eclipse.cdt.core.dom.ast.IASTEnumerationSpecifier.IASTEnumerator;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTFunctionDeclarator;
|
import org.eclipse.cdt.core.dom.ast.IASTFunctionDeclarator;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTFunctionDefinition;
|
import org.eclipse.cdt.core.dom.ast.IASTFunctionDefinition;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTNodeLocation;
|
import org.eclipse.cdt.core.dom.ast.IASTNodeLocation;
|
||||||
|
@ -34,7 +35,6 @@ import org.eclipse.cdt.core.dom.ast.IASTParameterDeclaration;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTSimpleDeclSpecifier;
|
import org.eclipse.cdt.core.dom.ast.IASTSimpleDeclSpecifier;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTSimpleDeclaration;
|
import org.eclipse.cdt.core.dom.ast.IASTSimpleDeclaration;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTStandardFunctionDeclarator;
|
import org.eclipse.cdt.core.dom.ast.IASTStandardFunctionDeclarator;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTEnumerationSpecifier.IASTEnumerator;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTFunctionDeclarator;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTFunctionDeclarator;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTLinkageSpecification;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTLinkageSpecification;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTTemplateDeclaration;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTTemplateDeclaration;
|
||||||
|
@ -73,7 +73,8 @@ public class DoxygenMultilineAutoEditStrategy extends DefaultMultilineCommentAut
|
||||||
boolean hasReturn= true;
|
boolean hasReturn= true;
|
||||||
if(ds instanceof IASTSimpleDeclSpecifier) {
|
if(ds instanceof IASTSimpleDeclSpecifier) {
|
||||||
IASTSimpleDeclSpecifier sds= (IASTSimpleDeclSpecifier) ds;
|
IASTSimpleDeclSpecifier sds= (IASTSimpleDeclSpecifier) ds;
|
||||||
if(sds.getType()==IASTSimpleDeclSpecifier.t_void) {
|
if(sds.getType() == IASTSimpleDeclSpecifier.t_void ||
|
||||||
|
sds.getType() == IASTSimpleDeclSpecifier.t_unspecified) {
|
||||||
hasReturn= false;
|
hasReturn= false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue