mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-07 17:56:01 +02:00
Cosmetics.
This commit is contained in:
parent
e51a76571e
commit
3852941d5c
4 changed files with 84 additions and 85 deletions
|
@ -88,7 +88,7 @@ import org.eclipse.core.runtime.IProgressMonitor;
|
||||||
import org.eclipse.core.runtime.OperationCanceledException;
|
import org.eclipse.core.runtime.OperationCanceledException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Build TranslationUnit structure from an <code>IASTTranslationUnit</code>.
|
* Build TranslationUnit structure from an {@code IASTTranslationUnit}.
|
||||||
*
|
*
|
||||||
* @since 4.0
|
* @since 4.0
|
||||||
*/
|
*/
|
||||||
|
@ -129,7 +129,7 @@ public class CModelBuilder2 implements IContributedModelBuilder {
|
||||||
if (index != null) {
|
if (index != null) {
|
||||||
try {
|
try {
|
||||||
index.acquireReadLock();
|
index.acquireReadLock();
|
||||||
} catch (InterruptedException ie) {
|
} catch (InterruptedException e) {
|
||||||
index= null;
|
index= null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -213,14 +213,14 @@ public class CModelBuilder2 implements IContributedModelBuilder {
|
||||||
createInclusion(fTranslationUnit, includeDirective);
|
createInclusion(fTranslationUnit, includeDirective);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// macros
|
// Macros
|
||||||
final IASTPreprocessorMacroDefinition[] macroDefinitions= ast.getMacroDefinitions();
|
final IASTPreprocessorMacroDefinition[] macroDefinitions= ast.getMacroDefinitions();
|
||||||
for (IASTPreprocessorMacroDefinition macroDefinition : macroDefinitions) {
|
for (IASTPreprocessorMacroDefinition macroDefinition : macroDefinitions) {
|
||||||
if (isLocalToFile(macroDefinition)) {
|
if (isLocalToFile(macroDefinition)) {
|
||||||
createMacro(fTranslationUnit, macroDefinition);
|
createMacro(fTranslationUnit, macroDefinition);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// declarations
|
// Declarations
|
||||||
final IASTDeclaration[] declarations= ast.getDeclarations(true);
|
final IASTDeclaration[] declarations= ast.getDeclarations(true);
|
||||||
for (IASTDeclaration declaration : declarations) {
|
for (IASTDeclaration declaration : declarations) {
|
||||||
if (isLocalToFile(declaration)) {
|
if (isLocalToFile(declaration)) {
|
||||||
|
@ -229,7 +229,7 @@ public class CModelBuilder2 implements IContributedModelBuilder {
|
||||||
}
|
}
|
||||||
fEqualElements.clear();
|
fEqualElements.clear();
|
||||||
|
|
||||||
// sort by offset
|
// Sort by offset
|
||||||
final List<ICElement> children= getElementInfo(fTranslationUnit).internalGetChildren();
|
final List<ICElement> children= getElementInfo(fTranslationUnit).internalGetChildren();
|
||||||
Collections.sort(children, new Comparator<ICElement>() {
|
Collections.sort(children, new Comparator<ICElement>() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -247,7 +247,7 @@ public class CModelBuilder2 implements IContributedModelBuilder {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// report problems
|
// Report problems
|
||||||
IProblemRequestor problemRequestor= fTranslationUnit.getProblemRequestor();
|
IProblemRequestor problemRequestor= fTranslationUnit.getProblemRequestor();
|
||||||
if (problemRequestor != null && problemRequestor.isActive()) {
|
if (problemRequestor != null && problemRequestor.isActive()) {
|
||||||
problemRequestor.beginReporting();
|
problemRequestor.beginReporting();
|
||||||
|
@ -273,7 +273,7 @@ public class CModelBuilder2 implements IContributedModelBuilder {
|
||||||
}
|
}
|
||||||
|
|
||||||
private Include createInclusion(Parent parent, IASTPreprocessorIncludeStatement inclusion) throws CModelException{
|
private Include createInclusion(Parent parent, IASTPreprocessorIncludeStatement inclusion) throws CModelException{
|
||||||
// create element
|
// Create element
|
||||||
final IASTName name= inclusion.getName();
|
final IASTName name= inclusion.getName();
|
||||||
Include element= new Include(parent, ASTStringUtil.getSimpleName(name), inclusion.isSystemInclude());
|
Include element= new Include(parent, ASTStringUtil.getSimpleName(name), inclusion.isSystemInclude());
|
||||||
element.setFullPathName(inclusion.getPath());
|
element.setFullPathName(inclusion.getPath());
|
||||||
|
@ -281,9 +281,9 @@ public class CModelBuilder2 implements IContributedModelBuilder {
|
||||||
|
|
||||||
element.setActive(inclusion.isActive());
|
element.setActive(inclusion.isActive());
|
||||||
element.setResolved(inclusion.isResolved());
|
element.setResolved(inclusion.isResolved());
|
||||||
// add to parent
|
// Add to parent
|
||||||
parent.addChild(element);
|
parent.addChild(element);
|
||||||
// set positions
|
// Set positions
|
||||||
setIdentifierPosition(element, name);
|
setIdentifierPosition(element, name);
|
||||||
setBodyPosition(element, inclusion);
|
setBodyPosition(element, inclusion);
|
||||||
return element;
|
return element;
|
||||||
|
@ -300,14 +300,14 @@ public class CModelBuilder2 implements IContributedModelBuilder {
|
||||||
}
|
}
|
||||||
|
|
||||||
private Macro createMacro(Parent parent, IASTPreprocessorMacroDefinition macro) throws CModelException{
|
private Macro createMacro(Parent parent, IASTPreprocessorMacroDefinition macro) throws CModelException{
|
||||||
// create element
|
// Create element
|
||||||
final IASTName name= macro.getName();
|
final IASTName name= macro.getName();
|
||||||
Macro element= new Macro(parent, ASTStringUtil.getSimpleName(name));
|
Macro element= new Macro(parent, ASTStringUtil.getSimpleName(name));
|
||||||
setIndex(element);
|
setIndex(element);
|
||||||
element.setActive(macro.isActive());
|
element.setActive(macro.isActive());
|
||||||
// add to parent
|
// Add to parent
|
||||||
parent.addChild(element);
|
parent.addChild(element);
|
||||||
// set positions
|
// Set positions
|
||||||
setIdentifierPosition(element, name);
|
setIdentifierPosition(element, name);
|
||||||
setBodyPosition(element, macro);
|
setBodyPosition(element, macro);
|
||||||
if (macro instanceof IASTPreprocessorFunctionStyleMacroDefinition) {
|
if (macro instanceof IASTPreprocessorFunctionStyleMacroDefinition) {
|
||||||
|
@ -318,27 +318,27 @@ public class CModelBuilder2 implements IContributedModelBuilder {
|
||||||
|
|
||||||
private void createDeclaration(Parent parent, IASTDeclaration declaration) throws CModelException, DOMException {
|
private void createDeclaration(Parent parent, IASTDeclaration declaration) throws CModelException, DOMException {
|
||||||
if (declaration instanceof IASTFunctionDefinition) {
|
if (declaration instanceof IASTFunctionDefinition) {
|
||||||
createFunctionDefinition(parent, (IASTFunctionDefinition)declaration, false);
|
createFunctionDefinition(parent, (IASTFunctionDefinition) declaration, false);
|
||||||
} else if (declaration instanceof IASTSimpleDeclaration) {
|
} else if (declaration instanceof IASTSimpleDeclaration) {
|
||||||
createSimpleDeclarations(parent, (IASTSimpleDeclaration)declaration, false);
|
createSimpleDeclarations(parent, (IASTSimpleDeclaration) declaration, false);
|
||||||
} else if (declaration instanceof ICPPASTVisibilityLabel) {
|
} else if (declaration instanceof ICPPASTVisibilityLabel) {
|
||||||
handleVisibilityLabel((ICPPASTVisibilityLabel)declaration);
|
handleVisibilityLabel((ICPPASTVisibilityLabel) declaration);
|
||||||
} else if (declaration instanceof ICPPASTNamespaceDefinition) {
|
} else if (declaration instanceof ICPPASTNamespaceDefinition) {
|
||||||
createNamespace(parent, (ICPPASTNamespaceDefinition) declaration);
|
createNamespace(parent, (ICPPASTNamespaceDefinition) declaration);
|
||||||
} else if (declaration instanceof ICPPASTNamespaceAlias) {
|
} else if (declaration instanceof ICPPASTNamespaceAlias) {
|
||||||
// TODO [cmodel] namespace alias?
|
// TODO [cmodel] namespace alias?
|
||||||
} else if (declaration instanceof ICPPASTTemplateDeclaration) {
|
} else if (declaration instanceof ICPPASTTemplateDeclaration) {
|
||||||
createTemplateDeclaration(parent, (ICPPASTTemplateDeclaration)declaration);
|
createTemplateDeclaration(parent, (ICPPASTTemplateDeclaration) declaration);
|
||||||
} else if (declaration instanceof ICPPASTTemplateSpecialization) {
|
} else if (declaration instanceof ICPPASTTemplateSpecialization) {
|
||||||
// TODO [cmodel] template specialization?
|
// TODO [cmodel] template specialization?
|
||||||
} else if (declaration instanceof ICPPASTExplicitTemplateInstantiation) {
|
} else if (declaration instanceof ICPPASTExplicitTemplateInstantiation) {
|
||||||
// TODO [cmodel] explicit template instantiation?
|
// TODO [cmodel] explicit template instantiation?
|
||||||
} else if (declaration instanceof ICPPASTUsingDeclaration) {
|
} else if (declaration instanceof ICPPASTUsingDeclaration) {
|
||||||
createUsingDeclaration(parent, (ICPPASTUsingDeclaration)declaration);
|
createUsingDeclaration(parent, (ICPPASTUsingDeclaration) declaration);
|
||||||
} else if (declaration instanceof ICPPASTUsingDirective) {
|
} else if (declaration instanceof ICPPASTUsingDirective) {
|
||||||
createUsingDirective(parent, (ICPPASTUsingDirective)declaration);
|
createUsingDirective(parent, (ICPPASTUsingDirective) declaration);
|
||||||
} else if (declaration instanceof ICPPASTLinkageSpecification) {
|
} else if (declaration instanceof ICPPASTLinkageSpecification) {
|
||||||
createLinkageSpecification(parent, (ICPPASTLinkageSpecification)declaration);
|
createLinkageSpecification(parent, (ICPPASTLinkageSpecification) declaration);
|
||||||
} else if (declaration instanceof IASTASMDeclaration) {
|
} else if (declaration instanceof IASTASMDeclaration) {
|
||||||
// TODO [cmodel] asm declaration?
|
// TODO [cmodel] asm declaration?
|
||||||
} else if (declaration instanceof IASTProblemDeclaration) {
|
} else if (declaration instanceof IASTProblemDeclaration) {
|
||||||
|
@ -353,7 +353,7 @@ public class CModelBuilder2 implements IContributedModelBuilder {
|
||||||
private void createTemplateDeclaration(Parent parent, ICPPASTTemplateDeclaration templateDeclaration) throws CModelException, DOMException {
|
private void createTemplateDeclaration(Parent parent, ICPPASTTemplateDeclaration templateDeclaration) throws CModelException, DOMException {
|
||||||
IASTDeclaration declaration= templateDeclaration.getDeclaration();
|
IASTDeclaration declaration= templateDeclaration.getDeclaration();
|
||||||
if (declaration instanceof IASTFunctionDefinition) {
|
if (declaration instanceof IASTFunctionDefinition) {
|
||||||
CElement element= createFunctionDefinition(parent, (IASTFunctionDefinition)declaration, true);
|
CElement element= createFunctionDefinition(parent, (IASTFunctionDefinition) declaration, true);
|
||||||
String[] parameterTypes= ASTStringUtil.getTemplateParameterArray(templateDeclaration.getTemplateParameters());
|
String[] parameterTypes= ASTStringUtil.getTemplateParameterArray(templateDeclaration.getTemplateParameters());
|
||||||
// set the template parameters
|
// set the template parameters
|
||||||
if (element instanceof FunctionTemplate) {
|
if (element instanceof FunctionTemplate) {
|
||||||
|
@ -368,7 +368,7 @@ public class CModelBuilder2 implements IContributedModelBuilder {
|
||||||
setBodyPosition((SourceManipulation)element, templateDeclaration);
|
setBodyPosition((SourceManipulation)element, templateDeclaration);
|
||||||
}
|
}
|
||||||
} else if (declaration instanceof IASTSimpleDeclaration) {
|
} else if (declaration instanceof IASTSimpleDeclaration) {
|
||||||
CElement[] elements= createSimpleDeclarations(parent, (IASTSimpleDeclaration)declaration, true);
|
CElement[] elements= createSimpleDeclarations(parent, (IASTSimpleDeclaration) declaration, true);
|
||||||
String[] parameterTypes= ASTStringUtil.getTemplateParameterArray(templateDeclaration.getTemplateParameters());
|
String[] parameterTypes= ASTStringUtil.getTemplateParameterArray(templateDeclaration.getTemplateParameters());
|
||||||
for (CElement element : elements) {
|
for (CElement element : elements) {
|
||||||
// set the template parameters
|
// set the template parameters
|
||||||
|
@ -401,7 +401,7 @@ public class CModelBuilder2 implements IContributedModelBuilder {
|
||||||
}
|
}
|
||||||
} else if (declaration instanceof ICPPASTTemplateDeclaration) {
|
} else if (declaration instanceof ICPPASTTemplateDeclaration) {
|
||||||
// strange: template decl inside template decl
|
// strange: template decl inside template decl
|
||||||
createTemplateDeclaration(parent, (ICPPASTTemplateDeclaration)declaration);
|
createTemplateDeclaration(parent, (ICPPASTTemplateDeclaration) declaration);
|
||||||
} else if (declaration instanceof IASTProblemDeclaration) {
|
} else if (declaration instanceof IASTProblemDeclaration) {
|
||||||
// ignore problem declarations (or create special elements for debugging?)
|
// ignore problem declarations (or create special elements for debugging?)
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -940,7 +940,7 @@ public class ClassTypeHelper {
|
||||||
for (IASTDeclarator memberDeclarator : memberDeclaration.getDeclarators()) {
|
for (IASTDeclarator memberDeclarator : memberDeclaration.getDeclarators()) {
|
||||||
IBinding memberBinding =
|
IBinding memberBinding =
|
||||||
ASTQueries.findInnermostDeclarator(memberDeclarator).getName().resolveBinding();
|
ASTQueries.findInnermostDeclarator(memberDeclarator).getName().resolveBinding();
|
||||||
if (member.equals(memberBinding)){
|
if (member.equals(memberBinding)) {
|
||||||
return visibility;
|
return visibility;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -977,7 +977,7 @@ public class ClassTypeHelper {
|
||||||
IASTDeclarator declarator = ((IASTFunctionDefinition) hostMember).getDeclarator();
|
IASTDeclarator declarator = ((IASTFunctionDefinition) hostMember).getDeclarator();
|
||||||
declarator = ASTQueries.findInnermostDeclarator(declarator);
|
declarator = ASTQueries.findInnermostDeclarator(declarator);
|
||||||
IBinding functionBinding = declarator.getName().resolveBinding();
|
IBinding functionBinding = declarator.getName().resolveBinding();
|
||||||
if (member.equals(functionBinding)){
|
if (member.equals(functionBinding)) {
|
||||||
return visibility;
|
return visibility;
|
||||||
}
|
}
|
||||||
} else if (hostMember instanceof ICPPASTAliasDeclaration) {
|
} else if (hostMember instanceof ICPPASTAliasDeclaration) {
|
||||||
|
|
|
@ -679,7 +679,7 @@ public class CompletionTests extends AbstractContentAssistTest {
|
||||||
|
|
||||||
//// to_be_replaced_
|
//// to_be_replaced_
|
||||||
//void gfunc(){aNew/*cursor*/
|
//void gfunc(){aNew/*cursor*/
|
||||||
public void testGlobalVariableBeforeSave_Bug180883() throws Exception {
|
public void testGlobalVariableBeforeSave_180883() throws Exception {
|
||||||
String replace= "// to_be_replaced_";
|
String replace= "// to_be_replaced_";
|
||||||
String globalVar= "int aNewGlobalVar;";
|
String globalVar= "int aNewGlobalVar;";
|
||||||
IDocument doc= getDocument();
|
IDocument doc= getDocument();
|
||||||
|
@ -696,7 +696,7 @@ public class CompletionTests extends AbstractContentAssistTest {
|
||||||
|
|
||||||
//void Printer::InitPrinter(unsigned char port) {
|
//void Printer::InitPrinter(unsigned char port) {
|
||||||
// Printer::/*cursor*/
|
// Printer::/*cursor*/
|
||||||
public void testPrivateStaticMember_Bug109480() throws Exception {
|
public void testPrivateStaticMember_109480() throws Exception {
|
||||||
// see https://bugs.eclipse.org/bugs/show_bug.cgi?id=109480
|
// see https://bugs.eclipse.org/bugs/show_bug.cgi?id=109480
|
||||||
final String[] expected= { "InitPrinter()", "port" };
|
final String[] expected= { "InitPrinter()", "port" };
|
||||||
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_REP_STRINGS);
|
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_REP_STRINGS);
|
||||||
|
@ -707,7 +707,7 @@ public class CompletionTests extends AbstractContentAssistTest {
|
||||||
// void blah(const vector3& v) { x += v./*cursor*/; }
|
// void blah(const vector3& v) { x += v./*cursor*/; }
|
||||||
// float x;
|
// float x;
|
||||||
// };
|
// };
|
||||||
public void testForwardMembersInInlineMethods_Bug103857a() throws Exception {
|
public void testForwardMembersInInlineMethods_103857a() throws Exception {
|
||||||
// see https://bugs.eclipse.org/bugs/show_bug.cgi?id=103857
|
// see https://bugs.eclipse.org/bugs/show_bug.cgi?id=103857
|
||||||
final String[] expected= { "x" };
|
final String[] expected= { "x" };
|
||||||
assertMinimumCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_REP_STRINGS);
|
assertMinimumCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_REP_STRINGS);
|
||||||
|
@ -723,14 +723,14 @@ public class CompletionTests extends AbstractContentAssistTest {
|
||||||
// }
|
// }
|
||||||
// typedef S T;
|
// typedef S T;
|
||||||
// };
|
// };
|
||||||
public void testForwardMembersInInlineMethods_Bug103857b() throws Exception {
|
public void testForwardMembersInInlineMethods_103857b() throws Exception {
|
||||||
// see https://bugs.eclipse.org/bugs/show_bug.cgi?id=185652
|
// see https://bugs.eclipse.org/bugs/show_bug.cgi?id=185652
|
||||||
final String[] expected= { "mem" };
|
final String[] expected= { "mem" };
|
||||||
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_REP_STRINGS);
|
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_REP_STRINGS);
|
||||||
}
|
}
|
||||||
|
|
||||||
// void Pri/*cursor*/
|
// void Pri/*cursor*/
|
||||||
public void testMethodDefinitionClassName_Bug190296() throws Exception {
|
public void testMethodDefinitionClassName_190296() throws Exception {
|
||||||
// see https://bugs.eclipse.org/bugs/show_bug.cgi?id=190296
|
// see https://bugs.eclipse.org/bugs/show_bug.cgi?id=190296
|
||||||
final String[] expected= { "Printer::" };
|
final String[] expected= { "Printer::" };
|
||||||
assertMinimumCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_REP_STRINGS);
|
assertMinimumCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_REP_STRINGS);
|
||||||
|
@ -838,7 +838,7 @@ public class CompletionTests extends AbstractContentAssistTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
// void func() {float a; a= 1./*cursor*/}
|
// void func() {float a; a= 1./*cursor*/}
|
||||||
public void testCompletionInFloatingPointLiteral_Bug193464() throws Exception {
|
public void testCompletionInFloatingPointLiteral_193464() throws Exception {
|
||||||
final String[] expected= new String[0];
|
final String[] expected= new String[0];
|
||||||
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_REP_STRINGS);
|
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_REP_STRINGS);
|
||||||
}
|
}
|
||||||
|
@ -1005,7 +1005,7 @@ public class CompletionTests extends AbstractContentAssistTest {
|
||||||
//
|
//
|
||||||
// INIT_PTR(pTh/*cursor*/);
|
// INIT_PTR(pTh/*cursor*/);
|
||||||
// }
|
// }
|
||||||
public void testCompletionInMacroArguments1_Bug200208() throws Exception {
|
public void testCompletionInMacroArguments1_200208() throws Exception {
|
||||||
final String[] expected= { "pThis" };
|
final String[] expected= { "pThis" };
|
||||||
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_REP_STRINGS);
|
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_REP_STRINGS);
|
||||||
}
|
}
|
||||||
|
@ -1024,7 +1024,7 @@ public class CompletionTests extends AbstractContentAssistTest {
|
||||||
// INIT_PTR(pThis);
|
// INIT_PTR(pThis);
|
||||||
// COPY_PTR(pThis->pIShell, pThis->pI/*cursor*/)
|
// COPY_PTR(pThis->pIShell, pThis->pI/*cursor*/)
|
||||||
// }
|
// }
|
||||||
public void testCompletionInMacroArguments2_Bug200208() throws Exception {
|
public void testCompletionInMacroArguments2_200208() throws Exception {
|
||||||
final String[] expected= { "pIShell" };
|
final String[] expected= { "pIShell" };
|
||||||
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_REP_STRINGS);
|
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_REP_STRINGS);
|
||||||
}
|
}
|
||||||
|
@ -1032,7 +1032,7 @@ public class CompletionTests extends AbstractContentAssistTest {
|
||||||
// void test() {
|
// void test() {
|
||||||
// int alocal, blocal;
|
// int alocal, blocal;
|
||||||
// if (alocal < b/*cursor*/
|
// if (alocal < b/*cursor*/
|
||||||
public void testCompletionAfterLessThan_Bug229062() throws Exception {
|
public void testCompletionAfterLessThan_229062() throws Exception {
|
||||||
final String[] expected= { "blocal" };
|
final String[] expected= { "blocal" };
|
||||||
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_REP_STRINGS);
|
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_REP_STRINGS);
|
||||||
}
|
}
|
||||||
|
@ -1043,7 +1043,7 @@ public class CompletionTests extends AbstractContentAssistTest {
|
||||||
// int byte2;
|
// int byte2;
|
||||||
// } MYSTRUCT_TYPE;
|
// } MYSTRUCT_TYPE;
|
||||||
// static const MYSTRUCT_TYPE myArrayOfStructs[] = {{enum/*cursor*/
|
// static const MYSTRUCT_TYPE myArrayOfStructs[] = {{enum/*cursor*/
|
||||||
public void testCompletionInInitializerList_Bug230389() throws Exception {
|
public void testCompletionInInitializerList_230389() throws Exception {
|
||||||
final String[] expected= { "enum0", "enum1", "enum2" };
|
final String[] expected= { "enum0", "enum1", "enum2" };
|
||||||
assertCompletionResults(expected);
|
assertCompletionResults(expected);
|
||||||
}
|
}
|
||||||
|
@ -1051,19 +1051,19 @@ public class CompletionTests extends AbstractContentAssistTest {
|
||||||
// void test() {
|
// void test() {
|
||||||
// C2 c2;
|
// C2 c2;
|
||||||
// c2(1)->iam/*cursor*/
|
// c2(1)->iam/*cursor*/
|
||||||
public void testUserdefinedCallOperator_Bug231277() throws Exception {
|
public void testUserdefinedCallOperator_231277() throws Exception {
|
||||||
final String[] expected= { "iam1()" };
|
final String[] expected= { "iam1()" };
|
||||||
assertCompletionResults(expected);
|
assertCompletionResults(expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
// void test() {struct s206450 x; x./*cursor*/
|
// void test() {struct s206450 x; x./*cursor*/
|
||||||
public void testNestedAnonymousStructs_Bug206450() throws Exception {
|
public void testNestedAnonymousStructs_206450() throws Exception {
|
||||||
final String[] expected= { "a1", "a2", "u1", "u2", "a4", "b", "s206450" };
|
final String[] expected= { "a1", "a2", "u1", "u2", "a4", "b", "s206450" };
|
||||||
assertCompletionResults(expected);
|
assertCompletionResults(expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
// void test() {_f204758/*cursor*/
|
// void test() {_f204758/*cursor*/
|
||||||
public void testTypedefToAnonymous_Bug204758() throws Exception {
|
public void testTypedefToAnonymous_204758() throws Exception {
|
||||||
final String[] expected= { "_f204758(_e204758 x) : void" };
|
final String[] expected= { "_f204758(_e204758 x) : void" };
|
||||||
assertCompletionResults(fCursorOffset, expected, COMPARE_DISP_STRINGS);
|
assertCompletionResults(fCursorOffset, expected, COMPARE_DISP_STRINGS);
|
||||||
}
|
}
|
||||||
|
@ -1076,7 +1076,7 @@ public class CompletionTests extends AbstractContentAssistTest {
|
||||||
// } catch (int var2) {
|
// } catch (int var2) {
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
public void testContentAssistWithBraceInMacro_Bug257915() throws Exception {
|
public void testContentAssistWithBraceInMacro_257915() throws Exception {
|
||||||
final String[] expected= { "var : float" };
|
final String[] expected= { "var : float" };
|
||||||
assertCompletionResults(fCursorOffset, expected, COMPARE_DISP_STRINGS);
|
assertCompletionResults(fCursorOffset, expected, COMPARE_DISP_STRINGS);
|
||||||
}
|
}
|
||||||
|
@ -1087,7 +1087,7 @@ public class CompletionTests extends AbstractContentAssistTest {
|
||||||
// void main() {
|
// void main() {
|
||||||
// X::T/*cursor*/ // content assist does not propose TInt
|
// X::T/*cursor*/ // content assist does not propose TInt
|
||||||
// }
|
// }
|
||||||
public void testNestedTypesInQualifiedNames_Bug255898() throws Exception {
|
public void testNestedTypesInQualifiedNames_255898() throws Exception {
|
||||||
final String[] expected= { "TInt" };
|
final String[] expected= { "TInt" };
|
||||||
assertCompletionResults(fCursorOffset, expected, COMPARE_DISP_STRINGS);
|
assertCompletionResults(fCursorOffset, expected, COMPARE_DISP_STRINGS);
|
||||||
}
|
}
|
||||||
|
@ -1103,7 +1103,7 @@ public class CompletionTests extends AbstractContentAssistTest {
|
||||||
// return myQueue->a/*cursor*/
|
// return myQueue->a/*cursor*/
|
||||||
// }
|
// }
|
||||||
//};
|
//};
|
||||||
public void testContentAssistInDeferredClassInstance_Bug194592() throws Exception {
|
public void testContentAssistInDeferredClassInstance_194592() throws Exception {
|
||||||
final String[] expected= { "add()" };
|
final String[] expected= { "add()" };
|
||||||
assertCompletionResults(fCursorOffset, expected, COMPARE_REP_STRINGS);
|
assertCompletionResults(fCursorOffset, expected, COMPARE_REP_STRINGS);
|
||||||
}
|
}
|
||||||
|
@ -1127,7 +1127,7 @@ public class CompletionTests extends AbstractContentAssistTest {
|
||||||
//public:
|
//public:
|
||||||
// InitializerListTest() : /*cursor*/
|
// InitializerListTest() : /*cursor*/
|
||||||
//};
|
//};
|
||||||
public void testConstructorInitializerList_EmptyInput_Bug266586() throws Exception {
|
public void testConstructorInitializerList_EmptyInput_266586() throws Exception {
|
||||||
final String[] expected= { "mOne", "Base",
|
final String[] expected= { "mOne", "Base",
|
||||||
"Base(int)", "Base(const Base<Helper> &)", "Helper",
|
"Base(int)", "Base(const Base<Helper> &)", "Helper",
|
||||||
"Helper(void)", "Helper(const Helper &)", "_A_331056", "_B_331056",
|
"Helper(void)", "Helper(const Helper &)", "_A_331056", "_B_331056",
|
||||||
|
@ -1157,7 +1157,7 @@ public class CompletionTests extends AbstractContentAssistTest {
|
||||||
//public:
|
//public:
|
||||||
// InitializerListTest() : ::ns/*cursor*/
|
// InitializerListTest() : ::ns/*cursor*/
|
||||||
//};
|
//};
|
||||||
public void testCunstructorInitializerList_NameContextInput_Bug266586() throws Exception {
|
public void testCunstructorInitializerList_NameContextInput_266586() throws Exception {
|
||||||
final String[] expected= { "ns" };
|
final String[] expected= { "ns" };
|
||||||
assertCompletionResults(fCursorOffset, expected, COMPARE_ID_STRINGS);
|
assertCompletionResults(fCursorOffset, expected, COMPARE_ID_STRINGS);
|
||||||
}
|
}
|
||||||
|
@ -1181,7 +1181,7 @@ public class CompletionTests extends AbstractContentAssistTest {
|
||||||
//public:
|
//public:
|
||||||
// InitializerListTest() : m/*cursor*/
|
// InitializerListTest() : m/*cursor*/
|
||||||
//};
|
//};
|
||||||
public void testCunstructorInitializerList_MemberInput_Bug266586() throws Exception {
|
public void testCunstructorInitializerList_MemberInput_266586() throws Exception {
|
||||||
final String[] expected= { "mOne" };
|
final String[] expected= { "mOne" };
|
||||||
assertCompletionResults(fCursorOffset, expected, COMPARE_ID_STRINGS);
|
assertCompletionResults(fCursorOffset, expected, COMPARE_ID_STRINGS);
|
||||||
}
|
}
|
||||||
|
@ -1205,7 +1205,7 @@ public class CompletionTests extends AbstractContentAssistTest {
|
||||||
//public:
|
//public:
|
||||||
// InitializerListTest() : h/*cursor*/
|
// InitializerListTest() : h/*cursor*/
|
||||||
//};
|
//};
|
||||||
public void testConstructorInitializerList_BaseClassInput_Bug266586() throws Exception {
|
public void testConstructorInitializerList_BaseClassInput_266586() throws Exception {
|
||||||
final String[] expected= { "Helper", "Helper(void)", "Helper(const Helper &)" };
|
final String[] expected= { "Helper", "Helper(void)", "Helper(const Helper &)" };
|
||||||
assertCompletionResults(fCursorOffset, expected, COMPARE_ID_STRINGS);
|
assertCompletionResults(fCursorOffset, expected, COMPARE_ID_STRINGS);
|
||||||
}
|
}
|
||||||
|
@ -1219,14 +1219,14 @@ public class CompletionTests extends AbstractContentAssistTest {
|
||||||
// vector<MyType> v;
|
// vector<MyType> v;
|
||||||
// v.push_back(/*cursor*/);
|
// v.push_back(/*cursor*/);
|
||||||
// }
|
// }
|
||||||
public void testTypedefSpecialization_Bug307818() throws Exception {
|
public void testTypedefSpecialization_307818() throws Exception {
|
||||||
final String[] expected= { "push_back(const vector<MyType>::value_type & value) : void" };
|
final String[] expected= { "push_back(const vector<MyType>::value_type & value) : void" };
|
||||||
assertParameterHint(expected);
|
assertParameterHint(expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
// using namespace ::_B_331056;
|
// using namespace ::_B_331056;
|
||||||
// Ref/*cursor*/
|
// Ref/*cursor*/
|
||||||
public void testUsingDeclaration_Bug331056() throws Exception {
|
public void testUsingDeclaration_331056() throws Exception {
|
||||||
final String[] expected= { "Reference" };
|
final String[] expected= { "Reference" };
|
||||||
assertCompletionResults(fCursorOffset, expected, COMPARE_ID_STRINGS);
|
assertCompletionResults(fCursorOffset, expected, COMPARE_ID_STRINGS);
|
||||||
}
|
}
|
||||||
|
@ -1239,7 +1239,7 @@ public class CompletionTests extends AbstractContentAssistTest {
|
||||||
// this->BaseM/*cursor*/
|
// this->BaseM/*cursor*/
|
||||||
// }
|
// }
|
||||||
// };
|
// };
|
||||||
public void testDeferredBaseClass_Bug330762() throws Exception {
|
public void testDeferredBaseClass_330762() throws Exception {
|
||||||
final String[] expected= { "BaseMethod(void)" };
|
final String[] expected= { "BaseMethod(void)" };
|
||||||
assertCompletionResults(fCursorOffset, expected, COMPARE_ID_STRINGS);
|
assertCompletionResults(fCursorOffset, expected, COMPARE_ID_STRINGS);
|
||||||
}
|
}
|
||||||
|
@ -1262,13 +1262,13 @@ public class CompletionTests extends AbstractContentAssistTest {
|
||||||
// void foo(int);
|
// void foo(int);
|
||||||
// }
|
// }
|
||||||
// using N::f/*cursor*/
|
// using N::f/*cursor*/
|
||||||
public void testUsingDeclaration_Bug379631() throws Exception {
|
public void testUsingDeclaration_379631() throws Exception {
|
||||||
final String[] expected= { "foo;" };
|
final String[] expected= { "foo;" };
|
||||||
assertCompletionResults(fCursorOffset, expected, COMPARE_REP_STRINGS);
|
assertCompletionResults(fCursorOffset, expected, COMPARE_REP_STRINGS);
|
||||||
}
|
}
|
||||||
|
|
||||||
// template <typen/*cursor*/
|
// template <typen/*cursor*/
|
||||||
public void testTemplateDeclaration_Bug397288() throws Exception {
|
public void testTemplateDeclaration_397288() throws Exception {
|
||||||
final String[] expected= { "typename" };
|
final String[] expected= { "typename" };
|
||||||
assertContentAssistResults(fCursorOffset, 0, expected, true, false, false, COMPARE_REP_STRINGS);
|
assertContentAssistResults(fCursorOffset, 0, expected, true, false, false, COMPARE_REP_STRINGS);
|
||||||
}
|
}
|
||||||
|
@ -1288,7 +1288,7 @@ public class CompletionTests extends AbstractContentAssistTest {
|
||||||
//
|
//
|
||||||
// Cat c;
|
// Cat c;
|
||||||
// };
|
// };
|
||||||
public void testShadowingBaseClassMember_Bug407807() throws Exception {
|
public void testShadowingBaseClassMember_407807() throws Exception {
|
||||||
final String[] expected = { "Cat", "meow(void)" };
|
final String[] expected = { "Cat", "meow(void)" };
|
||||||
assertContentAssistResults(fCursorOffset, expected, true, COMPARE_ID_STRINGS);
|
assertContentAssistResults(fCursorOffset, expected, true, COMPARE_ID_STRINGS);
|
||||||
}
|
}
|
||||||
|
@ -1308,7 +1308,7 @@ public class CompletionTests extends AbstractContentAssistTest {
|
||||||
// void foo() {
|
// void foo() {
|
||||||
// __LINE__;
|
// __LINE__;
|
||||||
// }
|
// }
|
||||||
public void testPreprocessorProvidedMacro_Bug412463() throws Exception {
|
public void testPreprocessorProvidedMacro_412463() throws Exception {
|
||||||
final String[] expected = { "Cat", "meow(void)" };
|
final String[] expected = { "Cat", "meow(void)" };
|
||||||
assertContentAssistResults(fCursorOffset, expected, true, COMPARE_ID_STRINGS);
|
assertContentAssistResults(fCursorOffset, expected, true, COMPARE_ID_STRINGS);
|
||||||
}
|
}
|
||||||
|
@ -1326,9 +1326,8 @@ public class CompletionTests extends AbstractContentAssistTest {
|
||||||
// };
|
// };
|
||||||
//
|
//
|
||||||
// int x = __CDT_PARSER__;
|
// int x = __CDT_PARSER__;
|
||||||
public void testPredefinedMacro_Bug412463() throws Exception {
|
public void testPredefinedMacro_412463() throws Exception {
|
||||||
final String[] expected = { "Cat", "meow(void)" };
|
final String[] expected = { "Cat", "meow(void)" };
|
||||||
assertContentAssistResults(fCursorOffset, expected, true, COMPARE_ID_STRINGS);
|
assertContentAssistResults(fCursorOffset, expected, true, COMPARE_ID_STRINGS);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -21,7 +21,7 @@ import junit.framework.TestSuite;
|
||||||
public class ContentAssist2TestSuite extends TestSuite {
|
public class ContentAssist2TestSuite extends TestSuite {
|
||||||
|
|
||||||
public static Test suite() {
|
public static Test suite() {
|
||||||
return new ContentAssist2TestSuite() ;
|
return new ContentAssist2TestSuite();
|
||||||
}
|
}
|
||||||
|
|
||||||
public ContentAssist2TestSuite() {
|
public ContentAssist2TestSuite() {
|
||||||
|
|
Loading…
Add table
Reference in a new issue