diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/selectiontests/BaseSelectionTestsIndexer.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/selectiontests/BaseSelectionTestsIndexer.java index d7187a6762c..799d22ebc47 100644 --- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/selectiontests/BaseSelectionTestsIndexer.java +++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/selectiontests/BaseSelectionTestsIndexer.java @@ -44,7 +44,7 @@ import org.eclipse.ui.texteditor.AbstractTextEditor; import junit.framework.TestCase; /** - * Base test class for testing F2/F3 with the indexers. + * Base test class for testing Ctrl_F3/F3 with the indexers. * * @author dsteffle */ @@ -207,11 +207,11 @@ public class BaseSelectionTestsIndexer extends TestCase { return null; } - protected IASTNode testF2(IFile file, int offset) throws ParserException { - return testF2(file, offset, 0); + protected IASTNode testCtrl_F3(IFile file, int offset) throws ParserException { + return testCtrl_F3(file, offset, 0); } - protected IASTNode testF2(IFile file, int offset, int length) throws ParserException { + protected IASTNode testCtrl_F3(IFile file, int offset, int length) throws ParserException { if (offset < 0) throw new ParserException("offset can not be less than 0 and was " + offset); //$NON-NLS-1$ @@ -254,11 +254,11 @@ public class BaseSelectionTestsIndexer extends TestCase { return null; } - protected ISelection testF2Selection(IFile file, int offset) throws ParserException { - return testF2Selection(file, offset, 0); + protected ISelection testCtrl_F3Selection(IFile file, int offset) throws ParserException { + return testCtrl_F3Selection(file, offset, 0); } - protected ISelection testF2Selection(IFile file, int offset, int length) throws ParserException { + protected ISelection testCtrl_F3Selection(IFile file, int offset, int length) throws ParserException { if (offset < 0) throw new ParserException("offset can not be less than 0 and was " + offset); //$NON-NLS-1$ diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/selectiontests/CPPSelectionTestsCTagsIndexer.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/selectiontests/CPPSelectionTestsCTagsIndexer.java index 7734720b04a..43e8b02193e 100644 --- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/selectiontests/CPPSelectionTestsCTagsIndexer.java +++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/selectiontests/CPPSelectionTestsCTagsIndexer.java @@ -41,7 +41,7 @@ import org.eclipse.jface.text.TextSelection; import org.eclipse.jface.viewers.ISelection; /** - * Test F2/F3 with the CTags Indexer for a CPP project. + * Test Ctrl_F3/F3 with the CTags Indexer for a CPP project. * * @author dsteffle */ @@ -143,7 +143,7 @@ public class CPPSelectionTestsCTagsIndexer extends BaseSelectionTestsIndexer IFile file = importFile("test.cpp", code); //$NON-NLS-1$ int offset = code.indexOf("x;\n}\n"); //$NON-NLS-1$ - IASTNode def = testF2(file, offset); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + IASTNode def = testCtrl_F3(file, offset); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ assertTrue(def instanceof IASTName); assertEquals(((ASTNode)def).getOffset(), header.indexOf("x;\n")); assertEquals(((ASTNode)def).getLength(), "x".length()); @@ -160,7 +160,7 @@ public class CPPSelectionTestsCTagsIndexer extends BaseSelectionTestsIndexer IFile file = importFile("test.cpp", code); //$NON-NLS-1$ int offset = code.indexOf("y;"); //$NON-NLS-1$ - IASTNode def = testF2(file, offset); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + IASTNode def = testCtrl_F3(file, offset); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ assertTrue(def instanceof IASTName); assertEquals(((ASTNode)def).getOffset(), header.indexOf("y;")); assertEquals(((ASTNode)def).getLength(), "y".length()); @@ -187,7 +187,7 @@ public class CPPSelectionTestsCTagsIndexer extends BaseSelectionTestsIndexer IFile file = importFile("testBasicDefinition.c", code); //$NON-NLS-1$ int offset = code.indexOf("MyInt;\n") + 2; //$NON-NLS-1$ - IASTNode def = testF2(file, offset); + IASTNode def = testCtrl_F3(file, offset); IASTNode decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -199,7 +199,7 @@ public class CPPSelectionTestsCTagsIndexer extends BaseSelectionTestsIndexer assertEquals(((ASTNode)def).getLength(), 5); offset = code.indexOf("MyConst = 42") + 2; //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -211,7 +211,7 @@ public class CPPSelectionTestsCTagsIndexer extends BaseSelectionTestsIndexer assertEquals(((ASTNode)def).getLength(), 7); offset = code.indexOf("MyFunc(int a)") + 2; //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -223,7 +223,7 @@ public class CPPSelectionTestsCTagsIndexer extends BaseSelectionTestsIndexer assertEquals(((ASTNode)def).getLength(), 6); offset = code.indexOf("MyStruct {") + 2; //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -277,7 +277,7 @@ public class CPPSelectionTestsCTagsIndexer extends BaseSelectionTestsIndexer IFile file = importFile("testCPPSpecDeclsDefs.c", code); //$NON-NLS-1$ int offset = code.indexOf("a; // defines a"); //$NON-NLS-1$ - IASTNode def = testF2(file, offset); + IASTNode def = testCtrl_F3(file, offset); IASTNode decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -289,7 +289,7 @@ public class CPPSelectionTestsCTagsIndexer extends BaseSelectionTestsIndexer assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("c = 1; // defines c"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -301,7 +301,7 @@ public class CPPSelectionTestsCTagsIndexer extends BaseSelectionTestsIndexer assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("f(int x) { return x+a; } // defines f and defines x"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -313,7 +313,7 @@ public class CPPSelectionTestsCTagsIndexer extends BaseSelectionTestsIndexer assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("x) { return x+a; } // defines f and defines x"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -325,7 +325,7 @@ public class CPPSelectionTestsCTagsIndexer extends BaseSelectionTestsIndexer assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("x+a; } // defines f and defines x"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -337,7 +337,7 @@ public class CPPSelectionTestsCTagsIndexer extends BaseSelectionTestsIndexer assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("x+a; } // defines f and defines x"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -349,7 +349,7 @@ public class CPPSelectionTestsCTagsIndexer extends BaseSelectionTestsIndexer assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("a; } // defines f and defines x"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -361,7 +361,7 @@ public class CPPSelectionTestsCTagsIndexer extends BaseSelectionTestsIndexer assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("S { int a; int b; }; // defines S, S::a, and S::b"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -373,7 +373,7 @@ public class CPPSelectionTestsCTagsIndexer extends BaseSelectionTestsIndexer assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("a; int b; }; // defines S, S::a, and S::b"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -385,7 +385,7 @@ public class CPPSelectionTestsCTagsIndexer extends BaseSelectionTestsIndexer assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("b; }; // defines S, S::a, and S::b"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -397,7 +397,7 @@ public class CPPSelectionTestsCTagsIndexer extends BaseSelectionTestsIndexer assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("X { // defines X"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -409,7 +409,7 @@ public class CPPSelectionTestsCTagsIndexer extends BaseSelectionTestsIndexer assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("x; // defines nonstatic data member x"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -421,7 +421,7 @@ public class CPPSelectionTestsCTagsIndexer extends BaseSelectionTestsIndexer assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("up, down }; // defines up and down"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -433,7 +433,7 @@ public class CPPSelectionTestsCTagsIndexer extends BaseSelectionTestsIndexer assertEquals(((ASTNode)def).getLength(), 2); offset = code.indexOf("down }; // defines up and down"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -445,7 +445,7 @@ public class CPPSelectionTestsCTagsIndexer extends BaseSelectionTestsIndexer assertEquals(((ASTNode)def).getLength(), 4); offset = code.indexOf("X anX; // defines anX"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -457,7 +457,7 @@ public class CPPSelectionTestsCTagsIndexer extends BaseSelectionTestsIndexer assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("anX; // defines anX"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -469,7 +469,7 @@ public class CPPSelectionTestsCTagsIndexer extends BaseSelectionTestsIndexer assertEquals(((ASTNode)def).getLength(), 3); offset = code.indexOf("a; // declares a"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -481,7 +481,7 @@ public class CPPSelectionTestsCTagsIndexer extends BaseSelectionTestsIndexer assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("c; // declares c"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -493,7 +493,7 @@ public class CPPSelectionTestsCTagsIndexer extends BaseSelectionTestsIndexer assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("f(int); // declares f"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -505,7 +505,7 @@ public class CPPSelectionTestsCTagsIndexer extends BaseSelectionTestsIndexer assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("S; // declares S"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -517,7 +517,7 @@ public class CPPSelectionTestsCTagsIndexer extends BaseSelectionTestsIndexer assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("Int; // declares Int"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -529,7 +529,7 @@ public class CPPSelectionTestsCTagsIndexer extends BaseSelectionTestsIndexer assertEquals(((ASTNode)def).getLength(), 3); offset = code.indexOf("X anotherX; // declares anotherX"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -541,7 +541,7 @@ public class CPPSelectionTestsCTagsIndexer extends BaseSelectionTestsIndexer assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("anotherX; // declares anotherX"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); try { assertNull(def); // TODO raised bug 96689 @@ -566,7 +566,7 @@ public class CPPSelectionTestsCTagsIndexer extends BaseSelectionTestsIndexer IFile file = importFile("testNoDefinitions.c", code); //$NON-NLS-1$ int offset = code.indexOf("a1; // declares a"); //$NON-NLS-1$ - IASTNode def = testF2(file, offset); + IASTNode def = testCtrl_F3(file, offset); IASTNode decl = testF3(file, offset); try { assertNull(def); // TODO raised bug 96689 @@ -579,7 +579,7 @@ public class CPPSelectionTestsCTagsIndexer extends BaseSelectionTestsIndexer assertEquals(((ASTNode)decl).getLength(), 2); offset = code.indexOf("c1; // declares c"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); try { assertNull(def); // TODO raised bug 96689 @@ -591,7 +591,7 @@ public class CPPSelectionTestsCTagsIndexer extends BaseSelectionTestsIndexer assertEquals(((ASTNode)decl).getLength(), 2); offset = code.indexOf("f1(int); // declares f"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertNull(def); assertTrue(decl instanceof IASTName); @@ -600,7 +600,7 @@ public class CPPSelectionTestsCTagsIndexer extends BaseSelectionTestsIndexer assertEquals(((ASTNode)decl).getLength(), 2); offset = code.indexOf("S1; // declares S"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); try { assertNull(def); // TODO raised bug 96690 @@ -612,7 +612,7 @@ public class CPPSelectionTestsCTagsIndexer extends BaseSelectionTestsIndexer assertEquals(((ASTNode)decl).getLength(), 2); offset = code.indexOf("Int; // declares Int"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -632,7 +632,7 @@ public class CPPSelectionTestsCTagsIndexer extends BaseSelectionTestsIndexer IFile file = importFile("test.cpp", code); int offset = code.indexOf("y;"); //$NON-NLS-1$ - IASTNode def = testF2(file, offset); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + IASTNode def = testCtrl_F3(file, offset); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ assertTrue(def instanceof IASTName); assertEquals(((ASTNode)def).getOffset(), header.indexOf("y;")); assertEquals(((ASTNode)def).getLength(), "y".length()); diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/selectiontests/CPPSelectionTestsDOMIndexer.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/selectiontests/CPPSelectionTestsDOMIndexer.java index 695641ade64..551f5c39f47 100644 --- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/selectiontests/CPPSelectionTestsDOMIndexer.java +++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/selectiontests/CPPSelectionTestsDOMIndexer.java @@ -40,7 +40,7 @@ import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.NullProgressMonitor; /** - * Test F2/F3 with the DOM Indexer for a C++ project. + * Test Ctrl_F3/F3 with the DOM Indexer for a C++ project. * * @author dsteffle */ @@ -199,7 +199,7 @@ public class CPPSelectionTestsDOMIndexer extends BaseSelectionTestsIndexer imple IFile file = importFile("testBasicDefinition.cpp", code); //$NON-NLS-1$ int offset = code.indexOf("MyInt;\n") + 2; //$NON-NLS-1$ - IASTNode def = testF2(file, offset); + IASTNode def = testCtrl_F3(file, offset); IASTNode decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -211,7 +211,7 @@ public class CPPSelectionTestsDOMIndexer extends BaseSelectionTestsIndexer imple assertEquals(((ASTNode)def).getLength(), 5); offset = code.indexOf("MyConst = 42") + 2; //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -223,7 +223,7 @@ public class CPPSelectionTestsDOMIndexer extends BaseSelectionTestsIndexer imple assertEquals(((ASTNode)def).getLength(), 7); offset = code.indexOf("MyFunc(int a)") + 2; //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -235,7 +235,7 @@ public class CPPSelectionTestsDOMIndexer extends BaseSelectionTestsIndexer imple assertEquals(((ASTNode)def).getLength(), 6); offset = code.indexOf("MyStruct {") + 2; //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -247,7 +247,7 @@ public class CPPSelectionTestsDOMIndexer extends BaseSelectionTestsIndexer imple assertEquals(((ASTNode)def).getLength(), 8); offset = code.indexOf("MyClass {") + 2; //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -271,7 +271,7 @@ public class CPPSelectionTestsDOMIndexer extends BaseSelectionTestsIndexer imple IFile file = importFile("testBug95224.cpp", code); //$NON-NLS-1$ int offset = code.indexOf("A(); // open definition "); //$NON-NLS-1$ - IASTNode def = testF2(file, offset); + IASTNode def = testCtrl_F3(file, offset); IASTNode decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -294,7 +294,7 @@ public class CPPSelectionTestsDOMIndexer extends BaseSelectionTestsIndexer imple IFile file = importFile("testBasicTemplateInstance.cpp", code); //$NON-NLS-1$ int offset = code.indexOf("AAA"); //$NON-NLS-1$ - IASTNode def1 = testF2(file, offset, 3); + IASTNode def1 = testCtrl_F3(file, offset, 3); IASTNode decl1 = testF3(file, offset, 3); assertTrue(def1 instanceof IASTName); assertTrue(decl1 instanceof IASTName); @@ -305,16 +305,16 @@ public class CPPSelectionTestsDOMIndexer extends BaseSelectionTestsIndexer imple assertEquals(((ASTNode)def1).getOffset(), 74); assertEquals(((ASTNode)def1).getLength(), 3); - IASTNode def2 = testF2(file, offset, 8); + IASTNode deCtrl_F3 = testCtrl_F3(file, offset, 8); IASTNode decl2 = testF3(file, offset, 8); - assertTrue(def2 instanceof IASTName); + assertTrue(deCtrl_F3 instanceof IASTName); assertTrue(decl2 instanceof IASTName); assertEquals(((IASTName)decl2).toString(), "AAA"); //$NON-NLS-1$ assertEquals(((ASTNode)decl2).getOffset(), 74); assertEquals(((ASTNode)decl2).getLength(), 3); - assertEquals(((IASTName)def2).toString(), "AAA"); //$NON-NLS-1$ - assertEquals(((ASTNode)def2).getOffset(), 74); - assertEquals(((ASTNode)def2).getLength(), 3); + assertEquals(((IASTName)deCtrl_F3).toString(), "AAA"); //$NON-NLS-1$ + assertEquals(((ASTNode)deCtrl_F3).getOffset(), 74); + assertEquals(((ASTNode)deCtrl_F3).getLength(), 3); } public void testBug86829A() throws Exception { @@ -357,7 +357,7 @@ public class CPPSelectionTestsDOMIndexer extends BaseSelectionTestsIndexer imple IFile file = importFile("testBug86829B.cpp", code); //$NON-NLS-1$ int offset = code.indexOf("X(a);"); //$NON-NLS-1$ - IASTNode def = testF2(file, offset); + IASTNode def = testCtrl_F3(file, offset); IASTNode decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -423,7 +423,7 @@ public class CPPSelectionTestsDOMIndexer extends BaseSelectionTestsIndexer imple IFile file = importFile("testCPPSpecDeclsDefs.cpp", code); //$NON-NLS-1$ int offset = code.indexOf("a; // defines a"); //$NON-NLS-1$ - IASTNode def = testF2(file, offset); + IASTNode def = testCtrl_F3(file, offset); IASTNode decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -435,7 +435,7 @@ public class CPPSelectionTestsDOMIndexer extends BaseSelectionTestsIndexer imple assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("c = 1; // defines c"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -447,7 +447,7 @@ public class CPPSelectionTestsDOMIndexer extends BaseSelectionTestsIndexer imple assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("f(int x) { return x+a; } // defines f and defines x"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -459,7 +459,7 @@ public class CPPSelectionTestsDOMIndexer extends BaseSelectionTestsIndexer imple assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("x) { return x+a; } // defines f and defines x"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -471,7 +471,7 @@ public class CPPSelectionTestsDOMIndexer extends BaseSelectionTestsIndexer imple assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("x+a; } // defines f and defines x"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -483,7 +483,7 @@ public class CPPSelectionTestsDOMIndexer extends BaseSelectionTestsIndexer imple assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("x+a; } // defines f and defines x"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -495,7 +495,7 @@ public class CPPSelectionTestsDOMIndexer extends BaseSelectionTestsIndexer imple assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("a; } // defines f and defines x"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -507,7 +507,7 @@ public class CPPSelectionTestsDOMIndexer extends BaseSelectionTestsIndexer imple assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("S { int a; int b; }; // defines S, S::a, and S::b"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -519,7 +519,7 @@ public class CPPSelectionTestsDOMIndexer extends BaseSelectionTestsIndexer imple assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("a; int b; }; // defines S, S::a, and S::b"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -531,7 +531,7 @@ public class CPPSelectionTestsDOMIndexer extends BaseSelectionTestsIndexer imple assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("b; }; // defines S, S::a, and S::b"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -543,7 +543,7 @@ public class CPPSelectionTestsDOMIndexer extends BaseSelectionTestsIndexer imple assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("X { // defines X"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -555,7 +555,7 @@ public class CPPSelectionTestsDOMIndexer extends BaseSelectionTestsIndexer imple assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("x; // defines nonstatic data member x"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -567,7 +567,7 @@ public class CPPSelectionTestsDOMIndexer extends BaseSelectionTestsIndexer imple assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("y; // declares static data member y"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -579,7 +579,7 @@ public class CPPSelectionTestsDOMIndexer extends BaseSelectionTestsIndexer imple assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("X(): x(0) { } // defines a constructor of X"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -591,7 +591,7 @@ public class CPPSelectionTestsDOMIndexer extends BaseSelectionTestsIndexer imple assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("x(0) { } // defines a constructor of X"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -603,7 +603,7 @@ public class CPPSelectionTestsDOMIndexer extends BaseSelectionTestsIndexer imple assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("X::y = 1; // defines X::y"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -615,7 +615,7 @@ public class CPPSelectionTestsDOMIndexer extends BaseSelectionTestsIndexer imple assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("y = 1; // defines X::y"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -627,7 +627,7 @@ public class CPPSelectionTestsDOMIndexer extends BaseSelectionTestsIndexer imple assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("up, down }; // defines up and down"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -639,7 +639,7 @@ public class CPPSelectionTestsDOMIndexer extends BaseSelectionTestsIndexer imple assertEquals(((ASTNode)def).getLength(), 2); offset = code.indexOf("down }; // defines up and down"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -651,7 +651,7 @@ public class CPPSelectionTestsDOMIndexer extends BaseSelectionTestsIndexer imple assertEquals(((ASTNode)def).getLength(), 4); offset = code.indexOf("N { int d; } // defines N and N::d"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -663,7 +663,7 @@ public class CPPSelectionTestsDOMIndexer extends BaseSelectionTestsIndexer imple assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("d; } // defines N and N::d"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -675,7 +675,7 @@ public class CPPSelectionTestsDOMIndexer extends BaseSelectionTestsIndexer imple assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("N1 = N; // defines N1"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -687,7 +687,7 @@ public class CPPSelectionTestsDOMIndexer extends BaseSelectionTestsIndexer imple assertEquals(((ASTNode)def).getLength(), 2); offset = code.indexOf("N; // defines N1"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -699,7 +699,7 @@ public class CPPSelectionTestsDOMIndexer extends BaseSelectionTestsIndexer imple assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("X anX; // defines anX"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -711,7 +711,7 @@ public class CPPSelectionTestsDOMIndexer extends BaseSelectionTestsIndexer imple assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("anX; // defines anX"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -723,7 +723,7 @@ public class CPPSelectionTestsDOMIndexer extends BaseSelectionTestsIndexer imple assertEquals(((ASTNode)def).getLength(), 3); offset = code.indexOf("a; // declares a"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -735,7 +735,7 @@ public class CPPSelectionTestsDOMIndexer extends BaseSelectionTestsIndexer imple assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("c; // declares c"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -747,7 +747,7 @@ public class CPPSelectionTestsDOMIndexer extends BaseSelectionTestsIndexer imple assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("f(int); // declares f"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -759,7 +759,7 @@ public class CPPSelectionTestsDOMIndexer extends BaseSelectionTestsIndexer imple assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("S; // declares S"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -771,7 +771,7 @@ public class CPPSelectionTestsDOMIndexer extends BaseSelectionTestsIndexer imple assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("Int; // declares Int"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); try { assertNull(def); // TODO raised bug 96689 @@ -783,7 +783,7 @@ public class CPPSelectionTestsDOMIndexer extends BaseSelectionTestsIndexer imple assertEquals(((ASTNode)decl).getLength(), 3); offset = code.indexOf("X anotherX; // declares anotherX"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -795,7 +795,7 @@ public class CPPSelectionTestsDOMIndexer extends BaseSelectionTestsIndexer imple assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("anotherX; // declares anotherX"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); try { assertNull(def); // TODO raised bug 96689 @@ -807,7 +807,7 @@ public class CPPSelectionTestsDOMIndexer extends BaseSelectionTestsIndexer imple assertEquals(((ASTNode)decl).getLength(), 8); offset = code.indexOf("N::d; // declares N::d"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -819,7 +819,7 @@ public class CPPSelectionTestsDOMIndexer extends BaseSelectionTestsIndexer imple assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("d; // declares N::d"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -854,7 +854,7 @@ public class CPPSelectionTestsDOMIndexer extends BaseSelectionTestsIndexer imple IFile file = importFile("testBug95225.cpp", code); //$NON-NLS-1$ int offset = code.indexOf("rflow('+',x,3.45e107);"); //$NON-NLS-1$ - IASTNode def = testF2(file, offset); + IASTNode def = testCtrl_F3(file, offset); IASTNode decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -866,7 +866,7 @@ public class CPPSelectionTestsDOMIndexer extends BaseSelectionTestsIndexer imple assertEquals(((ASTNode)def).getLength(), 8); offset = code.indexOf("x,3.45e107);"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -890,7 +890,7 @@ public class CPPSelectionTestsDOMIndexer extends BaseSelectionTestsIndexer imple IFile file = importFile("testNoDefinitions.cpp", code); //$NON-NLS-1$ int offset = code.indexOf("a1; // declares a"); //$NON-NLS-1$ - IASTNode def = testF2(file, offset); + IASTNode def = testCtrl_F3(file, offset); IASTNode decl = testF3(file, offset); try { assertNull(def); // TODO raised bug 96689 @@ -902,7 +902,7 @@ public class CPPSelectionTestsDOMIndexer extends BaseSelectionTestsIndexer imple assertEquals(((ASTNode)decl).getLength(), 2); offset = code.indexOf("c1; // declares c"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); try { assertNull(def); // TODO raised bug 96694 @@ -914,7 +914,7 @@ public class CPPSelectionTestsDOMIndexer extends BaseSelectionTestsIndexer imple assertEquals(((ASTNode)decl).getLength(), 2); offset = code.indexOf("f1(int); // declares f"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertNull(def); assertTrue(decl instanceof IASTName); @@ -923,7 +923,7 @@ public class CPPSelectionTestsDOMIndexer extends BaseSelectionTestsIndexer imple assertEquals(((ASTNode)decl).getLength(), 2); offset = code.indexOf("S1; // declares S"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertNull(def); assertTrue(decl instanceof IASTName); @@ -932,7 +932,7 @@ public class CPPSelectionTestsDOMIndexer extends BaseSelectionTestsIndexer imple assertEquals(((ASTNode)decl).getLength(), 2); offset = code.indexOf("Int; // declares Int"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); try { assertNull(def); // TODO raised bug 96689 @@ -959,7 +959,7 @@ public class CPPSelectionTestsDOMIndexer extends BaseSelectionTestsIndexer imple IFile file = importFile("testBug95202.cpp", code); //$NON-NLS-1$ int offset = code.indexOf("s); // wellformed"); //$NON-NLS-1$ - IASTNode def = testF2(file, offset); + IASTNode def = testCtrl_F3(file, offset); IASTNode decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -985,7 +985,7 @@ public class CPPSelectionTestsDOMIndexer extends BaseSelectionTestsIndexer imple IFile file = importFile("testBug95229.cpp", code); //$NON-NLS-1$ int offset = code.indexOf("rator short(); // F3"); //$NON-NLS-1$ - IASTNode def = testF2(file, offset); + IASTNode def = testCtrl_F3(file, offset); IASTNode decl = testF3(file, offset); assertNull(def); assertTrue(decl instanceof IASTName); @@ -1005,7 +1005,7 @@ public class CPPSelectionTestsDOMIndexer extends BaseSelectionTestsIndexer imple IFile file = importFile("testBug101287.c", code); //$NON-NLS-1$ int offset = code.indexOf("abc\n"); //$NON-NLS-1$ - IASTNode def = testF2(file, offset); + IASTNode def = testCtrl_F3(file, offset); IASTNode decl = testF3(file, offset); assertTrue(decl instanceof IASTName); assertEquals(((IASTName)decl).toString(), "abc"); //$NON-NLS-1$ diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/selectiontests/CPPSelectionTestsNoIndexer.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/selectiontests/CPPSelectionTestsNoIndexer.java index 2a9f266b66e..780f2d9e662 100644 --- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/selectiontests/CPPSelectionTestsNoIndexer.java +++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/selectiontests/CPPSelectionTestsNoIndexer.java @@ -187,11 +187,11 @@ public class CPPSelectionTestsNoIndexer extends TestCase { return null; } - protected IASTNode testF2(IFile file, int offset) throws ParserException { - return testF2(file, offset, 0); + protected IASTNode testCtrl_F3(IFile file, int offset) throws ParserException { + return testCtrl_F3(file, offset, 0); } - protected IASTNode testF2(IFile file, int offset, int length) throws ParserException { + protected IASTNode testCtrl_F3(IFile file, int offset, int length) throws ParserException { disableIndex(); if (offset < 0) @@ -299,7 +299,7 @@ public class CPPSelectionTestsNoIndexer extends TestCase { IFile file = importFile("testBasicDefinition.cpp", code); //$NON-NLS-1$ int offset = code.indexOf("MyInt;\n") + 2; //$NON-NLS-1$ - IASTNode def = testF2(file, offset); + IASTNode def = testCtrl_F3(file, offset); IASTNode decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -311,7 +311,7 @@ public class CPPSelectionTestsNoIndexer extends TestCase { assertEquals(((ASTNode)def).getLength(), 5); offset = code.indexOf("MyConst = 42") + 2; //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -323,7 +323,7 @@ public class CPPSelectionTestsNoIndexer extends TestCase { assertEquals(((ASTNode)def).getLength(), 7); offset = code.indexOf("MyFunc(int a)") + 2; //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -335,7 +335,7 @@ public class CPPSelectionTestsNoIndexer extends TestCase { assertEquals(((ASTNode)def).getLength(), 6); offset = code.indexOf("MyStruct {") + 2; //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -347,7 +347,7 @@ public class CPPSelectionTestsNoIndexer extends TestCase { assertEquals(((ASTNode)def).getLength(), 8); offset = code.indexOf("MyClass {") + 2; //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -371,7 +371,7 @@ public class CPPSelectionTestsNoIndexer extends TestCase { IFile file = importFile("testBug95224.cpp", code); //$NON-NLS-1$ int offset = code.indexOf("A(); // open definition "); //$NON-NLS-1$ - IASTNode def = testF2(file, offset); + IASTNode def = testCtrl_F3(file, offset); IASTNode decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -394,7 +394,7 @@ public class CPPSelectionTestsNoIndexer extends TestCase { IFile file = importFile("testBasicTemplateInstance.cpp", code); //$NON-NLS-1$ int offset = code.indexOf("AAA"); //$NON-NLS-1$ - IASTNode def1 = testF2(file, offset, 3); + IASTNode def1 = testCtrl_F3(file, offset, 3); IASTNode decl1 = testF3(file, offset, 3); assertTrue(def1 instanceof IASTName); assertTrue(decl1 instanceof IASTName); @@ -405,16 +405,16 @@ public class CPPSelectionTestsNoIndexer extends TestCase { assertEquals(((ASTNode)def1).getOffset(), 74); assertEquals(((ASTNode)def1).getLength(), 3); - IASTNode def2 = testF2(file, offset, 8); + IASTNode deCtrl_F3 = testCtrl_F3(file, offset, 8); IASTNode decl2 = testF3(file, offset, 8); - assertTrue(def2 instanceof IASTName); + assertTrue(deCtrl_F3 instanceof IASTName); assertTrue(decl2 instanceof IASTName); assertEquals(((IASTName)decl2).toString(), "AAA"); //$NON-NLS-1$ assertEquals(((ASTNode)decl2).getOffset(), 74); assertEquals(((ASTNode)decl2).getLength(), 3); - assertEquals(((IASTName)def2).toString(), "AAA"); //$NON-NLS-1$ - assertEquals(((ASTNode)def2).getOffset(), 74); - assertEquals(((ASTNode)def2).getLength(), 3); + assertEquals(((IASTName)deCtrl_F3).toString(), "AAA"); //$NON-NLS-1$ + assertEquals(((ASTNode)deCtrl_F3).getOffset(), 74); + assertEquals(((ASTNode)deCtrl_F3).getLength(), 3); } public void testBug86829A() throws Exception { @@ -457,7 +457,7 @@ public class CPPSelectionTestsNoIndexer extends TestCase { IFile file = importFile("testBug86829B.cpp", code); //$NON-NLS-1$ int offset = code.indexOf("X(a);"); //$NON-NLS-1$ - IASTNode def = testF2(file, offset); + IASTNode def = testCtrl_F3(file, offset); IASTNode decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -523,7 +523,7 @@ public class CPPSelectionTestsNoIndexer extends TestCase { IFile file = importFile("testCPPSpecDeclsDefs.cpp", code); //$NON-NLS-1$ int offset = code.indexOf("a; // defines a"); //$NON-NLS-1$ - IASTNode def = testF2(file, offset); + IASTNode def = testCtrl_F3(file, offset); IASTNode decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -535,7 +535,7 @@ public class CPPSelectionTestsNoIndexer extends TestCase { assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("c = 1; // defines c"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -547,7 +547,7 @@ public class CPPSelectionTestsNoIndexer extends TestCase { assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("f(int x) { return x+a; } // defines f and defines x"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -559,7 +559,7 @@ public class CPPSelectionTestsNoIndexer extends TestCase { assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("x) { return x+a; } // defines f and defines x"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -571,7 +571,7 @@ public class CPPSelectionTestsNoIndexer extends TestCase { assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("x+a; } // defines f and defines x"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -583,7 +583,7 @@ public class CPPSelectionTestsNoIndexer extends TestCase { assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("x+a; } // defines f and defines x"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -595,7 +595,7 @@ public class CPPSelectionTestsNoIndexer extends TestCase { assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("a; } // defines f and defines x"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -607,7 +607,7 @@ public class CPPSelectionTestsNoIndexer extends TestCase { assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("S { int a; int b; }; // defines S, S::a, and S::b"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -619,7 +619,7 @@ public class CPPSelectionTestsNoIndexer extends TestCase { assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("a; int b; }; // defines S, S::a, and S::b"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -631,7 +631,7 @@ public class CPPSelectionTestsNoIndexer extends TestCase { assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("b; }; // defines S, S::a, and S::b"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -643,7 +643,7 @@ public class CPPSelectionTestsNoIndexer extends TestCase { assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("X { // defines X"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -655,7 +655,7 @@ public class CPPSelectionTestsNoIndexer extends TestCase { assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("x; // defines nonstatic data member x"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -667,7 +667,7 @@ public class CPPSelectionTestsNoIndexer extends TestCase { assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("y; // declares static data member y"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -679,7 +679,7 @@ public class CPPSelectionTestsNoIndexer extends TestCase { assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("X(): x(0) { } // defines a constructor of X"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -691,7 +691,7 @@ public class CPPSelectionTestsNoIndexer extends TestCase { assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("x(0) { } // defines a constructor of X"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -703,7 +703,7 @@ public class CPPSelectionTestsNoIndexer extends TestCase { assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("X::y = 1; // defines X::y"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -715,7 +715,7 @@ public class CPPSelectionTestsNoIndexer extends TestCase { assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("y = 1; // defines X::y"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -727,7 +727,7 @@ public class CPPSelectionTestsNoIndexer extends TestCase { assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("up, down }; // defines up and down"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -739,7 +739,7 @@ public class CPPSelectionTestsNoIndexer extends TestCase { assertEquals(((ASTNode)def).getLength(), 2); offset = code.indexOf("down }; // defines up and down"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -751,7 +751,7 @@ public class CPPSelectionTestsNoIndexer extends TestCase { assertEquals(((ASTNode)def).getLength(), 4); offset = code.indexOf("N { int d; } // defines N and N::d"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -763,7 +763,7 @@ public class CPPSelectionTestsNoIndexer extends TestCase { assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("d; } // defines N and N::d"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -775,7 +775,7 @@ public class CPPSelectionTestsNoIndexer extends TestCase { assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("N1 = N; // defines N1"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -787,7 +787,7 @@ public class CPPSelectionTestsNoIndexer extends TestCase { assertEquals(((ASTNode)def).getLength(), 2); offset = code.indexOf("N; // defines N1"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -799,7 +799,7 @@ public class CPPSelectionTestsNoIndexer extends TestCase { assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("X anX; // defines anX"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -811,7 +811,7 @@ public class CPPSelectionTestsNoIndexer extends TestCase { assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("anX; // defines anX"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -823,7 +823,7 @@ public class CPPSelectionTestsNoIndexer extends TestCase { assertEquals(((ASTNode)def).getLength(), 3); offset = code.indexOf("a; // declares a"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -835,7 +835,7 @@ public class CPPSelectionTestsNoIndexer extends TestCase { assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("c; // declares c"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -847,7 +847,7 @@ public class CPPSelectionTestsNoIndexer extends TestCase { assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("f(int); // declares f"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -859,7 +859,7 @@ public class CPPSelectionTestsNoIndexer extends TestCase { assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("S; // declares S"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -871,7 +871,7 @@ public class CPPSelectionTestsNoIndexer extends TestCase { assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("Int; // declares Int"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertNull(def); assertTrue(decl instanceof IASTName); @@ -880,7 +880,7 @@ public class CPPSelectionTestsNoIndexer extends TestCase { assertEquals(((ASTNode)decl).getLength(), 3); offset = code.indexOf("X anotherX; // declares anotherX"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -892,7 +892,7 @@ public class CPPSelectionTestsNoIndexer extends TestCase { assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("anotherX; // declares anotherX"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertNull(def); assertTrue(decl instanceof IASTName); @@ -901,7 +901,7 @@ public class CPPSelectionTestsNoIndexer extends TestCase { assertEquals(((ASTNode)decl).getLength(), 8); offset = code.indexOf("N::d; // declares N::d"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -913,7 +913,7 @@ public class CPPSelectionTestsNoIndexer extends TestCase { assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("d; // declares N::d"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -948,7 +948,7 @@ public class CPPSelectionTestsNoIndexer extends TestCase { IFile file = importFile("testBug95225.cpp", code); //$NON-NLS-1$ int offset = code.indexOf("rflow('+',x,3.45e107);"); //$NON-NLS-1$ - IASTNode def = testF2(file, offset); + IASTNode def = testCtrl_F3(file, offset); IASTNode decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -960,7 +960,7 @@ public class CPPSelectionTestsNoIndexer extends TestCase { assertEquals(((ASTNode)def).getLength(), 8); offset = code.indexOf("x,3.45e107);"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -984,7 +984,7 @@ public class CPPSelectionTestsNoIndexer extends TestCase { IFile file = importFile("testNoDefinitions.cpp", code); //$NON-NLS-1$ int offset = code.indexOf("a1; // declares a"); //$NON-NLS-1$ - IASTNode def = testF2(file, offset); + IASTNode def = testCtrl_F3(file, offset); IASTNode decl = testF3(file, offset); assertNull(def); assertTrue(decl instanceof IASTName); @@ -993,7 +993,7 @@ public class CPPSelectionTestsNoIndexer extends TestCase { assertEquals(((ASTNode)decl).getLength(), 2); offset = code.indexOf("c1; // declares c"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertNull(def); assertTrue(decl instanceof IASTName); @@ -1002,7 +1002,7 @@ public class CPPSelectionTestsNoIndexer extends TestCase { assertEquals(((ASTNode)decl).getLength(), 2); offset = code.indexOf("f1(int); // declares f"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertNull(def); assertTrue(decl instanceof IASTName); @@ -1011,7 +1011,7 @@ public class CPPSelectionTestsNoIndexer extends TestCase { assertEquals(((ASTNode)decl).getLength(), 2); offset = code.indexOf("S1; // declares S"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertNull(def); assertTrue(decl instanceof IASTName); @@ -1020,7 +1020,7 @@ public class CPPSelectionTestsNoIndexer extends TestCase { assertEquals(((ASTNode)decl).getLength(), 2); offset = code.indexOf("Int; // declares Int"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertNull(def); assertTrue(decl instanceof IASTName); @@ -1044,7 +1044,7 @@ public class CPPSelectionTestsNoIndexer extends TestCase { IFile file = importFile("testBug95202.cpp", code); //$NON-NLS-1$ int offset = code.indexOf("s); // wellformed"); //$NON-NLS-1$ - IASTNode def = testF2(file, offset); + IASTNode def = testCtrl_F3(file, offset); IASTNode decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -1070,7 +1070,7 @@ public class CPPSelectionTestsNoIndexer extends TestCase { IFile file = importFile("testBug95229.cpp", code); //$NON-NLS-1$ int offset = code.indexOf("rator short(); // F3"); //$NON-NLS-1$ - IASTNode def = testF2(file, offset); + IASTNode def = testCtrl_F3(file, offset); IASTNode decl = testF3(file, offset); assertNull(def); assertTrue(decl instanceof IASTName); diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/selectiontests/CSelectionTestsCTagsIndexer.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/selectiontests/CSelectionTestsCTagsIndexer.java index fe2081fcc81..d73217744c5 100644 --- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/selectiontests/CSelectionTestsCTagsIndexer.java +++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/selectiontests/CSelectionTestsCTagsIndexer.java @@ -39,7 +39,7 @@ import org.eclipse.jface.text.TextSelection; import org.eclipse.jface.viewers.ISelection; /** - * Test F2/F3 with the CTags Indexer for a C project. + * Test Ctrl_F3/F3 with the CTags Indexer for a C project. * * @author dsteffle */ @@ -136,7 +136,7 @@ public class CSelectionTestsCTagsIndexer extends BaseSelectionTestsIndexer IFile file = importFile("test.c", code); //$NON-NLS-1$ int offset = code.indexOf("x();\n}\n"); //$NON-NLS-1$ - ISelection def = testF2Selection(file, offset); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + ISelection def = testCtrl_F3Selection(file, offset); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ if (def instanceof TextSelection) { assertEquals(((TextSelection)def).getOffset(), header.indexOf("int x() { return 1; }\n")); assertEquals(((TextSelection)def).getLength(), "int x() { return 1; }\n".length()); @@ -155,7 +155,7 @@ public class CSelectionTestsCTagsIndexer extends BaseSelectionTestsIndexer IFile file = importFile("test.c", code); //$NON-NLS-1$ int offset = code.indexOf("y();\n}\n"); //$NON-NLS-1$ - ISelection def = testF2Selection(file, offset); + ISelection def = testCtrl_F3Selection(file, offset); if (def instanceof TextSelection) { assertEquals(((TextSelection)def).getOffset(), header.indexOf("int y() { return 1; }\r\n")); assertEquals(((TextSelection)def).getLength(), "int y() { return 1; }\r\n".length()); @@ -184,7 +184,7 @@ public class CSelectionTestsCTagsIndexer extends BaseSelectionTestsIndexer IFile file = importFile("testBasicDefinition.c", code); //$NON-NLS-1$ int offset = code.indexOf("MyInt;\n") + 2; //$NON-NLS-1$ - IASTNode def = testF2(file, offset); + IASTNode def = testCtrl_F3(file, offset); IASTNode decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -196,7 +196,7 @@ public class CSelectionTestsCTagsIndexer extends BaseSelectionTestsIndexer assertEquals(((ASTNode)def).getLength(), 5); offset = code.indexOf("MyConst = 42") + 2; //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -208,7 +208,7 @@ public class CSelectionTestsCTagsIndexer extends BaseSelectionTestsIndexer assertEquals(((ASTNode)def).getLength(), 7); offset = code.indexOf("MyFunc(int a)") + 2; //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -220,7 +220,7 @@ public class CSelectionTestsCTagsIndexer extends BaseSelectionTestsIndexer assertEquals(((ASTNode)def).getLength(), 6); offset = code.indexOf("MyStruct {") + 2; //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -274,7 +274,7 @@ public class CSelectionTestsCTagsIndexer extends BaseSelectionTestsIndexer IFile file = importFile("testCPPSpecDeclsDefs.c", code); //$NON-NLS-1$ int offset = code.indexOf("a; // defines a"); //$NON-NLS-1$ - IASTNode def = testF2(file, offset); + IASTNode def = testCtrl_F3(file, offset); IASTNode decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -286,7 +286,7 @@ public class CSelectionTestsCTagsIndexer extends BaseSelectionTestsIndexer assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("c = 1; // defines c"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -298,7 +298,7 @@ public class CSelectionTestsCTagsIndexer extends BaseSelectionTestsIndexer assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("f(int x) { return x+a; } // defines f and defines x"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -310,7 +310,7 @@ public class CSelectionTestsCTagsIndexer extends BaseSelectionTestsIndexer assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("x) { return x+a; } // defines f and defines x"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -322,7 +322,7 @@ public class CSelectionTestsCTagsIndexer extends BaseSelectionTestsIndexer assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("x+a; } // defines f and defines x"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -334,7 +334,7 @@ public class CSelectionTestsCTagsIndexer extends BaseSelectionTestsIndexer assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("x+a; } // defines f and defines x"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -346,7 +346,7 @@ public class CSelectionTestsCTagsIndexer extends BaseSelectionTestsIndexer assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("a; } // defines f and defines x"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -358,7 +358,7 @@ public class CSelectionTestsCTagsIndexer extends BaseSelectionTestsIndexer assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("S { int a; int b; }; // defines S, S::a, and S::b"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -370,7 +370,7 @@ public class CSelectionTestsCTagsIndexer extends BaseSelectionTestsIndexer assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("a; int b; }; // defines S, S::a, and S::b"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -382,7 +382,7 @@ public class CSelectionTestsCTagsIndexer extends BaseSelectionTestsIndexer assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("b; }; // defines S, S::a, and S::b"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -394,7 +394,7 @@ public class CSelectionTestsCTagsIndexer extends BaseSelectionTestsIndexer assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("X { // defines X"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -406,7 +406,7 @@ public class CSelectionTestsCTagsIndexer extends BaseSelectionTestsIndexer assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("x; // defines nonstatic data member x"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -418,7 +418,7 @@ public class CSelectionTestsCTagsIndexer extends BaseSelectionTestsIndexer assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("up, down }; // defines up and down"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -430,7 +430,7 @@ public class CSelectionTestsCTagsIndexer extends BaseSelectionTestsIndexer assertEquals(((ASTNode)def).getLength(), 2); offset = code.indexOf("down }; // defines up and down"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -442,7 +442,7 @@ public class CSelectionTestsCTagsIndexer extends BaseSelectionTestsIndexer assertEquals(((ASTNode)def).getLength(), 4); offset = code.indexOf("X anX; // defines anX"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -454,7 +454,7 @@ public class CSelectionTestsCTagsIndexer extends BaseSelectionTestsIndexer assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("anX; // defines anX"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -466,7 +466,7 @@ public class CSelectionTestsCTagsIndexer extends BaseSelectionTestsIndexer assertEquals(((ASTNode)def).getLength(), 3); offset = code.indexOf("a; // declares a"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -478,7 +478,7 @@ public class CSelectionTestsCTagsIndexer extends BaseSelectionTestsIndexer assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("c; // declares c"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -490,7 +490,7 @@ public class CSelectionTestsCTagsIndexer extends BaseSelectionTestsIndexer assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("f(int); // declares f"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -502,7 +502,7 @@ public class CSelectionTestsCTagsIndexer extends BaseSelectionTestsIndexer assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("S; // declares S"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -514,7 +514,7 @@ public class CSelectionTestsCTagsIndexer extends BaseSelectionTestsIndexer assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("Int; // declares Int"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -526,7 +526,7 @@ public class CSelectionTestsCTagsIndexer extends BaseSelectionTestsIndexer assertEquals(((ASTNode)def).getLength(), 3); offset = code.indexOf("X anotherX; // declares anotherX"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -538,7 +538,7 @@ public class CSelectionTestsCTagsIndexer extends BaseSelectionTestsIndexer assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("anotherX; // declares anotherX"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertNull(def); @@ -560,7 +560,7 @@ public class CSelectionTestsCTagsIndexer extends BaseSelectionTestsIndexer IFile file = importFile("testNoDefinitions.c", code); //$NON-NLS-1$ int offset = code.indexOf("a1; // declares a"); //$NON-NLS-1$ - IASTNode def = testF2(file, offset); + IASTNode def = testCtrl_F3(file, offset); IASTNode decl = testF3(file, offset); assertNull(def); @@ -570,7 +570,7 @@ public class CSelectionTestsCTagsIndexer extends BaseSelectionTestsIndexer assertEquals(((ASTNode)decl).getLength(), 2); offset = code.indexOf("c1; // declares c"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertNull(def); assertTrue(decl instanceof IASTName); @@ -579,7 +579,7 @@ public class CSelectionTestsCTagsIndexer extends BaseSelectionTestsIndexer assertEquals(((ASTNode)decl).getLength(), 2); offset = code.indexOf("f1(int); // declares f"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertNull(def); assertTrue(decl instanceof IASTName); @@ -588,7 +588,7 @@ public class CSelectionTestsCTagsIndexer extends BaseSelectionTestsIndexer assertEquals(((ASTNode)decl).getLength(), 2); offset = code.indexOf("S1; // declares S"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertNull(def); assertTrue(decl instanceof IASTName); @@ -597,7 +597,7 @@ public class CSelectionTestsCTagsIndexer extends BaseSelectionTestsIndexer assertEquals(((ASTNode)decl).getLength(), 2); offset = code.indexOf("Int; // declares Int"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -617,7 +617,7 @@ public class CSelectionTestsCTagsIndexer extends BaseSelectionTestsIndexer IFile file = importFile("test.c", code); int offset = code.indexOf("y();\n}\n"); //$NON-NLS-1$ - ISelection def = testF2Selection(file, offset); + ISelection def = testCtrl_F3Selection(file, offset); if (def instanceof TextSelection) { assertEquals(((TextSelection)def).getOffset(), header.indexOf(" int y() { return 1; } /* comment */ \r\n")); //$NON-NLS-1$ assertEquals(((TextSelection)def).getLength(), " int y() { return 1; } /* comment */ \r\n".length()); //$NON-NLS-1$ diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/selectiontests/CSelectionTestsDOMIndexer.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/selectiontests/CSelectionTestsDOMIndexer.java index ff24429cf61..056e57a3606 100644 --- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/selectiontests/CSelectionTestsDOMIndexer.java +++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/selectiontests/CSelectionTestsDOMIndexer.java @@ -36,7 +36,7 @@ import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.NullProgressMonitor; /** - * Test F2/F3 with the DOM Indexer for a C project. + * Test Ctrl_F3/F3 with the DOM Indexer for a C project. * * @author dsteffle */ @@ -131,7 +131,7 @@ public class CSelectionTestsDOMIndexer extends BaseSelectionTestsIndexer impleme IFile file = importFile("test.c", code); int offset = code.indexOf("x();\n}\n"); - IASTNode def = testF2(file, offset); + IASTNode def = testCtrl_F3(file, offset); assertTrue(def instanceof IASTName); assertEquals(((ASTNode)def).getOffset(), header.indexOf("x")); //$NON-NLS-1$ assertEquals(((ASTNode)def).getLength(), "x".length()); //$NON-NLS-1$ @@ -149,7 +149,7 @@ public class CSelectionTestsDOMIndexer extends BaseSelectionTestsIndexer impleme IFile file = importFile("test.c", code); int offset = code.indexOf("y();\n}\n"); - IASTNode def = testF2(file, offset); + IASTNode def = testCtrl_F3(file, offset); assertTrue(def instanceof IASTName); assertEquals(((ASTNode)def).getOffset(), header.indexOf("y")); //$NON-NLS-1$ assertEquals(((ASTNode)def).getLength(), "y".length()); //$NON-NLS-1$ @@ -177,7 +177,7 @@ public class CSelectionTestsDOMIndexer extends BaseSelectionTestsIndexer impleme IFile file = importFile("testBasicDefinition.c", code); //$NON-NLS-1$ int offset = code.indexOf("MyInt;\n") + 2; //$NON-NLS-1$ - IASTNode def = testF2(file, offset); + IASTNode def = testCtrl_F3(file, offset); IASTNode decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -189,7 +189,7 @@ public class CSelectionTestsDOMIndexer extends BaseSelectionTestsIndexer impleme assertEquals(((ASTNode)def).getLength(), 5); offset = code.indexOf("MyConst = 42") + 2; //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -201,7 +201,7 @@ public class CSelectionTestsDOMIndexer extends BaseSelectionTestsIndexer impleme assertEquals(((ASTNode)def).getLength(), 7); offset = code.indexOf("MyFunc(int a)") + 2; //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -213,7 +213,7 @@ public class CSelectionTestsDOMIndexer extends BaseSelectionTestsIndexer impleme assertEquals(((ASTNode)def).getLength(), 6); offset = code.indexOf("MyStruct {") + 2; //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -267,7 +267,7 @@ public class CSelectionTestsDOMIndexer extends BaseSelectionTestsIndexer impleme IFile file = importFile("testCPPSpecDeclsDefs.c", code); //$NON-NLS-1$ int offset = code.indexOf("a; // defines a"); //$NON-NLS-1$ - IASTNode def = testF2(file, offset); + IASTNode def = testCtrl_F3(file, offset); IASTNode decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -279,7 +279,7 @@ public class CSelectionTestsDOMIndexer extends BaseSelectionTestsIndexer impleme assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("c = 1; // defines c"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -291,7 +291,7 @@ public class CSelectionTestsDOMIndexer extends BaseSelectionTestsIndexer impleme assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("f(int x) { return x+a; } // defines f and defines x"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -303,7 +303,7 @@ public class CSelectionTestsDOMIndexer extends BaseSelectionTestsIndexer impleme assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("x) { return x+a; } // defines f and defines x"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -315,7 +315,7 @@ public class CSelectionTestsDOMIndexer extends BaseSelectionTestsIndexer impleme assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("x+a; } // defines f and defines x"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -327,7 +327,7 @@ public class CSelectionTestsDOMIndexer extends BaseSelectionTestsIndexer impleme assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("x+a; } // defines f and defines x"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -339,7 +339,7 @@ public class CSelectionTestsDOMIndexer extends BaseSelectionTestsIndexer impleme assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("a; } // defines f and defines x"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -351,7 +351,7 @@ public class CSelectionTestsDOMIndexer extends BaseSelectionTestsIndexer impleme assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("S { int a; int b; }; // defines S, S::a, and S::b"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -363,7 +363,7 @@ public class CSelectionTestsDOMIndexer extends BaseSelectionTestsIndexer impleme assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("a; int b; }; // defines S, S::a, and S::b"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -375,7 +375,7 @@ public class CSelectionTestsDOMIndexer extends BaseSelectionTestsIndexer impleme assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("b; }; // defines S, S::a, and S::b"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -387,7 +387,7 @@ public class CSelectionTestsDOMIndexer extends BaseSelectionTestsIndexer impleme assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("X { // defines X"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -399,7 +399,7 @@ public class CSelectionTestsDOMIndexer extends BaseSelectionTestsIndexer impleme assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("x; // defines nonstatic data member x"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -411,7 +411,7 @@ public class CSelectionTestsDOMIndexer extends BaseSelectionTestsIndexer impleme assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("up, down }; // defines up and down"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -423,7 +423,7 @@ public class CSelectionTestsDOMIndexer extends BaseSelectionTestsIndexer impleme assertEquals(((ASTNode)def).getLength(), 2); offset = code.indexOf("down }; // defines up and down"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -435,7 +435,7 @@ public class CSelectionTestsDOMIndexer extends BaseSelectionTestsIndexer impleme assertEquals(((ASTNode)def).getLength(), 4); offset = code.indexOf("X anX; // defines anX"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -447,7 +447,7 @@ public class CSelectionTestsDOMIndexer extends BaseSelectionTestsIndexer impleme assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("anX; // defines anX"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -459,7 +459,7 @@ public class CSelectionTestsDOMIndexer extends BaseSelectionTestsIndexer impleme assertEquals(((ASTNode)def).getLength(), 3); offset = code.indexOf("a; // declares a"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -471,7 +471,7 @@ public class CSelectionTestsDOMIndexer extends BaseSelectionTestsIndexer impleme assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("c; // declares c"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -483,7 +483,7 @@ public class CSelectionTestsDOMIndexer extends BaseSelectionTestsIndexer impleme assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("f(int); // declares f"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -495,7 +495,7 @@ public class CSelectionTestsDOMIndexer extends BaseSelectionTestsIndexer impleme assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("S; // declares S"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -507,7 +507,7 @@ public class CSelectionTestsDOMIndexer extends BaseSelectionTestsIndexer impleme assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("Int; // declares Int"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -519,7 +519,7 @@ public class CSelectionTestsDOMIndexer extends BaseSelectionTestsIndexer impleme assertEquals(((ASTNode)def).getLength(), 3); offset = code.indexOf("X anotherX; // declares anotherX"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -531,7 +531,7 @@ public class CSelectionTestsDOMIndexer extends BaseSelectionTestsIndexer impleme assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("anotherX; // declares anotherX"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertNull(def); @@ -553,7 +553,7 @@ public class CSelectionTestsDOMIndexer extends BaseSelectionTestsIndexer impleme IFile file = importFile("testNoDefinitions.c", code); //$NON-NLS-1$ int offset = code.indexOf("a1; // declares a"); //$NON-NLS-1$ - IASTNode def = testF2(file, offset); + IASTNode def = testCtrl_F3(file, offset); IASTNode decl = testF3(file, offset); assertNull(def); @@ -563,7 +563,7 @@ public class CSelectionTestsDOMIndexer extends BaseSelectionTestsIndexer impleme assertEquals(((ASTNode)decl).getLength(), 2); offset = code.indexOf("c1; // declares c"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertNull(def); assertTrue(decl instanceof IASTName); @@ -572,7 +572,7 @@ public class CSelectionTestsDOMIndexer extends BaseSelectionTestsIndexer impleme assertEquals(((ASTNode)decl).getLength(), 2); offset = code.indexOf("f1(int); // declares f"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertNull(def); assertTrue(decl instanceof IASTName); @@ -581,7 +581,7 @@ public class CSelectionTestsDOMIndexer extends BaseSelectionTestsIndexer impleme assertEquals(((ASTNode)decl).getLength(), 2); offset = code.indexOf("S1; // declares S"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertNull(def); assertTrue(decl instanceof IASTName); @@ -590,7 +590,7 @@ public class CSelectionTestsDOMIndexer extends BaseSelectionTestsIndexer impleme assertEquals(((ASTNode)decl).getLength(), 2); offset = code.indexOf("Int; // declares Int"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -610,7 +610,7 @@ public class CSelectionTestsDOMIndexer extends BaseSelectionTestsIndexer impleme IFile file = importFile("test.c", code); int offset = code.indexOf("y();\n}\n"); - IASTNode def = testF2(file, offset); + IASTNode def = testCtrl_F3(file, offset); assertTrue(def instanceof IASTName); assertEquals(((ASTNode)def).getOffset(), header.indexOf("y")); //$NON-NLS-1$ assertEquals(((ASTNode)def).getLength(), "y".length()); //$NON-NLS-1$ @@ -632,7 +632,7 @@ public class CSelectionTestsDOMIndexer extends BaseSelectionTestsIndexer impleme IFile file = importFile("testBug101287.c", code); //$NON-NLS-1$ int offset = code.indexOf("abc\n"); //$NON-NLS-1$ - IASTNode def = testF2(file, offset); + IASTNode def = testCtrl_F3(file, offset); IASTNode decl = testF3(file, offset); assertTrue(decl instanceof IASTName); assertEquals(((IASTName)decl).toString(), "abc"); //$NON-NLS-1$ diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/selectiontests/CSelectionTestsNoIndexer.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/selectiontests/CSelectionTestsNoIndexer.java index cdf3f436cdf..56e27bc3c7c 100644 --- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/selectiontests/CSelectionTestsNoIndexer.java +++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/selectiontests/CSelectionTestsNoIndexer.java @@ -184,11 +184,11 @@ public class CSelectionTestsNoIndexer extends TestCase { return null; } - protected IASTNode testF2(IFile file, int offset) throws ParserException { - return testF2(file, offset, 0); + protected IASTNode testCtrl_F3(IFile file, int offset) throws ParserException { + return testCtrl_F3(file, offset, 0); } - protected IASTNode testF2(IFile file, int offset, int length) throws ParserException { + protected IASTNode testCtrl_F3(IFile file, int offset, int length) throws ParserException { disableIndex(); if (offset < 0) @@ -247,7 +247,7 @@ public class CSelectionTestsNoIndexer extends TestCase { IFile file = importFile("testBasicDefinition.c", code); //$NON-NLS-1$ int offset = code.indexOf("MyInt;\n") + 2; //$NON-NLS-1$ - IASTNode def = testF2(file, offset); + IASTNode def = testCtrl_F3(file, offset); IASTNode decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -259,7 +259,7 @@ public class CSelectionTestsNoIndexer extends TestCase { assertEquals(((ASTNode)def).getLength(), 5); offset = code.indexOf("MyConst = 42") + 2; //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -271,7 +271,7 @@ public class CSelectionTestsNoIndexer extends TestCase { assertEquals(((ASTNode)def).getLength(), 7); offset = code.indexOf("MyFunc(int a)") + 2; //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -283,7 +283,7 @@ public class CSelectionTestsNoIndexer extends TestCase { assertEquals(((ASTNode)def).getLength(), 6); offset = code.indexOf("MyStruct {") + 2; //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -337,7 +337,7 @@ public class CSelectionTestsNoIndexer extends TestCase { IFile file = importFile("testCPPSpecDeclsDefs.c", code); //$NON-NLS-1$ int offset = code.indexOf("a; // defines a"); //$NON-NLS-1$ - IASTNode def = testF2(file, offset); + IASTNode def = testCtrl_F3(file, offset); IASTNode decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -349,7 +349,7 @@ public class CSelectionTestsNoIndexer extends TestCase { assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("c = 1; // defines c"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -361,7 +361,7 @@ public class CSelectionTestsNoIndexer extends TestCase { assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("f(int x) { return x+a; } // defines f and defines x"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -373,7 +373,7 @@ public class CSelectionTestsNoIndexer extends TestCase { assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("x) { return x+a; } // defines f and defines x"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -385,7 +385,7 @@ public class CSelectionTestsNoIndexer extends TestCase { assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("x+a; } // defines f and defines x"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -397,7 +397,7 @@ public class CSelectionTestsNoIndexer extends TestCase { assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("x+a; } // defines f and defines x"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -409,7 +409,7 @@ public class CSelectionTestsNoIndexer extends TestCase { assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("a; } // defines f and defines x"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -421,7 +421,7 @@ public class CSelectionTestsNoIndexer extends TestCase { assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("S { int a; int b; }; // defines S, S::a, and S::b"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -433,7 +433,7 @@ public class CSelectionTestsNoIndexer extends TestCase { assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("a; int b; }; // defines S, S::a, and S::b"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -445,7 +445,7 @@ public class CSelectionTestsNoIndexer extends TestCase { assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("b; }; // defines S, S::a, and S::b"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -457,7 +457,7 @@ public class CSelectionTestsNoIndexer extends TestCase { assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("X { // defines X"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -469,7 +469,7 @@ public class CSelectionTestsNoIndexer extends TestCase { assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("x; // defines nonstatic data member x"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -481,7 +481,7 @@ public class CSelectionTestsNoIndexer extends TestCase { assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("up, down }; // defines up and down"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -493,7 +493,7 @@ public class CSelectionTestsNoIndexer extends TestCase { assertEquals(((ASTNode)def).getLength(), 2); offset = code.indexOf("down }; // defines up and down"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -505,7 +505,7 @@ public class CSelectionTestsNoIndexer extends TestCase { assertEquals(((ASTNode)def).getLength(), 4); offset = code.indexOf("X anX; // defines anX"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -517,7 +517,7 @@ public class CSelectionTestsNoIndexer extends TestCase { assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("anX; // defines anX"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -529,7 +529,7 @@ public class CSelectionTestsNoIndexer extends TestCase { assertEquals(((ASTNode)def).getLength(), 3); offset = code.indexOf("a; // declares a"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -541,7 +541,7 @@ public class CSelectionTestsNoIndexer extends TestCase { assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("c; // declares c"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -553,7 +553,7 @@ public class CSelectionTestsNoIndexer extends TestCase { assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("f(int); // declares f"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -565,7 +565,7 @@ public class CSelectionTestsNoIndexer extends TestCase { assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("S; // declares S"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -577,7 +577,7 @@ public class CSelectionTestsNoIndexer extends TestCase { assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("Int; // declares Int"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -589,7 +589,7 @@ public class CSelectionTestsNoIndexer extends TestCase { assertEquals(((ASTNode)def).getLength(), 3); offset = code.indexOf("X anotherX; // declares anotherX"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); @@ -601,7 +601,7 @@ public class CSelectionTestsNoIndexer extends TestCase { assertEquals(((ASTNode)def).getLength(), 1); offset = code.indexOf("anotherX; // declares anotherX"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertNull(def); assertTrue(decl instanceof IASTName); @@ -622,7 +622,7 @@ public class CSelectionTestsNoIndexer extends TestCase { IFile file = importFile("testNoDefinitions.c", code); //$NON-NLS-1$ int offset = code.indexOf("a1; // declares a"); //$NON-NLS-1$ - IASTNode def = testF2(file, offset); + IASTNode def = testCtrl_F3(file, offset); IASTNode decl = testF3(file, offset); assertNull(def); assertTrue(decl instanceof IASTName); @@ -631,7 +631,7 @@ public class CSelectionTestsNoIndexer extends TestCase { assertEquals(((ASTNode)decl).getLength(), 2); offset = code.indexOf("c1; // declares c"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertNull(def); assertTrue(decl instanceof IASTName); @@ -640,7 +640,7 @@ public class CSelectionTestsNoIndexer extends TestCase { assertEquals(((ASTNode)decl).getLength(), 2); offset = code.indexOf("f1(int); // declares f"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertNull(def); assertTrue(decl instanceof IASTName); @@ -649,7 +649,7 @@ public class CSelectionTestsNoIndexer extends TestCase { assertEquals(((ASTNode)decl).getLength(), 2); offset = code.indexOf("S1; // declares S"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertNull(def); assertTrue(decl instanceof IASTName); @@ -658,7 +658,7 @@ public class CSelectionTestsNoIndexer extends TestCase { assertEquals(((ASTNode)decl).getLength(), 2); offset = code.indexOf("Int; // declares Int"); //$NON-NLS-1$ - def = testF2(file, offset); + def = testCtrl_F3(file, offset); decl = testF3(file, offset); assertTrue(def instanceof IASTName); assertTrue(decl instanceof IASTName); diff --git a/core/org.eclipse.cdt.ui/plugin.xml b/core/org.eclipse.cdt.ui/plugin.xml index 15672166776..1f9524fac7c 100644 --- a/core/org.eclipse.cdt.ui/plugin.xml +++ b/core/org.eclipse.cdt.ui/plugin.xml @@ -885,7 +885,7 @@ commandId="org.eclipse.cdt.ui.edit.text.c.remove.block.comment" schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"/> diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CEditorMessages.properties b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CEditorMessages.properties index 7ae9c8059e9..029e4ac16ab 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CEditorMessages.properties +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CEditorMessages.properties @@ -76,7 +76,7 @@ OpenDeclarations.label=&Open Declaration@F3 OpenDeclarations.tooltip=Open an editor on the selected element's declaration OpenDefinition.description=Open an editor on the selected element's definition -OpenDefinition.label=Open &Definition@F2 +OpenDefinition.label=Open &Definition@Ctrl+F3 OpenDefinition.tooltip=Open an editor on the selected element's definition OpenOutline.description=Shows outline diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/actions/OpenDefinitionAction.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/actions/OpenDefinitionAction.java index 5b8ecdf7376..c2510eb45a2 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/actions/OpenDefinitionAction.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/actions/OpenDefinitionAction.java @@ -43,7 +43,7 @@ import org.eclipse.jface.operation.IRunnableWithProgress; import org.eclipse.ui.texteditor.IUpdate; /** - * Open Definition Action (F2). + * Open Definition Action (Ctrl+F3). * * @author dsteffle */