diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CVisitor.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CVisitor.java index 46ccf27fb22..93d91dbaa2a 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CVisitor.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CVisitor.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2007 IBM Corporation and others. + * Copyright (c) 2005, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -423,17 +423,26 @@ public class CVisitor { return PROCESS_CONTINUE; } - if( CharArrayUtils.equals(name.toCharArray(), binding.getNameCharArray()) && - name.resolveBinding() == binding ){ - if( refs.length == idx ){ - IASTName [] temp = new IASTName[ refs.length * 2 ]; - System.arraycopy( refs, 0, temp, 0, refs.length ); - refs = temp; + if( CharArrayUtils.equals(name.toCharArray(), binding.getNameCharArray()) ) + if (sameBinding(name.resolveBinding(), binding)){ + if( refs.length == idx ){ + IASTName [] temp = new IASTName[ refs.length * 2 ]; + System.arraycopy( refs, 0, temp, 0, refs.length ); + refs = temp; + } + refs[idx++] = name; } - refs[idx++] = name; - } return PROCESS_CONTINUE; } + + private boolean sameBinding(IBinding binding1, IBinding binding2) { + if (binding1 == binding2) + return true; + if (binding1.equals(binding2)) + return true; + return false; + } + public IASTName[] getReferences(){ if( idx < refs.length ){ IASTName [] temp = new IASTName[ idx ]; @@ -2024,7 +2033,7 @@ public class CVisitor { } //label names - List b3 = new ArrayList(); + List b3 = new ArrayList(); do{ char [] n = name.toCharArray(); if( scope instanceof ICFunctionScope ){ diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPVisitor.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPVisitor.java index bffe1572cea..294f12af11f 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPVisitor.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPVisitor.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2007 IBM Corporation and others. + * Copyright (c) 2004, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -1338,6 +1338,7 @@ public class CPPVisitor { prop == ICPPASTTypenameExpression.TYPENAME || prop == ICPPASTUsingDeclaration.NAME || prop == ICPPASTCompositeTypeSpecifier.ICPPASTBaseSpecifier.NAME || + prop == ICPPASTTemplateId.TEMPLATE_NAME || p2 == ICPPASTQualifiedName.SEGMENT_NAME ) { break; @@ -1374,7 +1375,7 @@ public class CPPVisitor { p2 == ICPPASTQualifiedName.SEGMENT_NAME ) { break; - } + } return PROCESS_CONTINUE; } diff --git a/core/org.eclipse.cdt.ui.tests/resources/ceditor/occurrences.cpp b/core/org.eclipse.cdt.ui.tests/resources/ceditor/occurrences.cpp new file mode 100644 index 00000000000..4148c6a4344 --- /dev/null +++ b/core/org.eclipse.cdt.ui.tests/resources/ceditor/occurrences.cpp @@ -0,0 +1,109 @@ +#define INT int +#define FUNCTION_MACRO(arg) globalFunc(arg) + +enum Enumeration { + ONE, TWO, THREE +}; + +const int globalConstant = 0; +int globalVariable = 0; +static int globalStaticVariable = 0; + +void globalFunc(int a); +static void globalStaticFunc() { + globalVariable = 1; +} +; + +class Base1 { +}; +class Base2 { +}; + +class ClassContainer : Base1, Base2 { +public: + static int staticPubField; + const int constPubField; + const static int constStaticPubField; + int pubField; + + static INT staticPubMethod(int arg) { + FUNCTION_MACRO(arg); + globalFunc(arg); + return globalStaticVariable; + } + int pubMethod(); + + typedef float pubTypedef; + pubTypedef tdField; +private: + static INT staticPrivMethod(); +}; + +template class TemplateClass { + T1 tArg1; + T2 tArg2; + TemplateClass(T1 arg1, T2 arg2) { + tArg1 = arg1; + tArg2 = arg2; + } +}; + +template class PartialInstantiatedClass : TemplateClass { +}; + +struct CppStruct { + CppStruct() {} + int structField; +}; + +union CppUnion { + int unionField; +}; + +typedef CppUnion TUnion; + +namespace ns { +int namespaceVar = 0; +int namespaceFunc() { + globalStaticFunc(); + TUnion tu; + Enumeration e= TWO; + switch (e) { + case ONE: case THREE: + return 1; + } + return namespaceVar; +} +} + +INT ClassContainer::pubMethod() { + int localVar = 0; + ns::namespaceVar= 1; + return pubField + localVar; +} + +INT ClassContainer::staticPrivMethod() { + CppStruct* st= new CppStruct(); + st->structField= 1; + CppUnion un; + un.unionField= 2; + staticPubMethod(staticPubField); +label: + FUNCTION_MACRO(0); + if (un.unionField < st->structField) + goto label; + return globalConstant; +} + +template +class ConstantTemplate { +public: + int foo(int y) { + return X; + } +}; + +ConstantTemplate<5> c5; +ConstantTemplate<5> c52; +ConstantTemplate<4> c4; diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/AbstractSemanticHighlightingTest.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/AbstractSemanticHighlightingTest.java index e1444962d28..fa722c81a35 100644 --- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/AbstractSemanticHighlightingTest.java +++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/AbstractSemanticHighlightingTest.java @@ -175,7 +175,7 @@ public class AbstractSemanticHighlightingTest extends TestCase { protected void setUp() throws Exception { super.setUp(); disableAllSemanticHighlightings(); - EditorTestHelper.runEventQueue(1000); + EditorTestHelper.runEventQueue(500); } protected void assertEqualPositions(Position[] expected, Position[] actual) { diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/MarkOccurrenceTest.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/MarkOccurrenceTest.java new file mode 100644 index 00000000000..0abc1a89a97 --- /dev/null +++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/MarkOccurrenceTest.java @@ -0,0 +1,401 @@ +/******************************************************************************* + * Copyright (c) 2000, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + * Anton Leherbauer (Wind River Systems) + *******************************************************************************/ + +package org.eclipse.cdt.ui.tests.text; + +import java.util.Iterator; + +import junit.extensions.TestSetup; +import junit.framework.Test; +import junit.framework.TestCase; +import junit.framework.TestSuite; + +import org.eclipse.core.resources.IFile; +import org.eclipse.core.resources.ResourcesPlugin; +import org.eclipse.core.runtime.IPath; +import org.eclipse.core.runtime.Path; +import org.eclipse.jface.preference.IPreferenceStore; +import org.eclipse.jface.preference.PreferenceConverter; +import org.eclipse.jface.text.BadLocationException; +import org.eclipse.jface.text.FindReplaceDocumentAdapter; +import org.eclipse.jface.text.IDocument; +import org.eclipse.jface.text.IRegion; +import org.eclipse.jface.text.ITextSelection; +import org.eclipse.jface.text.Position; +import org.eclipse.jface.text.Region; +import org.eclipse.jface.text.source.Annotation; +import org.eclipse.jface.text.source.IAnnotationModel; +import org.eclipse.swt.custom.StyleRange; +import org.eclipse.swt.custom.StyledText; +import org.eclipse.swt.graphics.RGB; +import org.eclipse.ui.IEditorPart; +import org.eclipse.ui.PartInitException; +import org.eclipse.ui.PlatformUI; +import org.eclipse.ui.editors.text.EditorsUI; +import org.eclipse.ui.internal.editors.text.EditorsPlugin; +import org.eclipse.ui.texteditor.AnnotationPreference; + +import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit; +import org.eclipse.cdt.core.model.ICProject; +import org.eclipse.cdt.core.testplugin.CProjectHelper; +import org.eclipse.cdt.ui.CUIPlugin; +import org.eclipse.cdt.ui.PreferenceConstants; + +import org.eclipse.cdt.internal.ui.editor.CEditor; +import org.eclipse.cdt.internal.ui.viewsupport.ISelectionListenerWithAST; +import org.eclipse.cdt.internal.ui.viewsupport.SelectionListenerWithASTManager; + + +/** + * Tests the C/C++ Editor's occurrence marking feature. + * + * @since 5.0 + */ +public class MarkOccurrenceTest extends TestCase { + + private static final String PROJECT = "MarkOccurrenceTest"; + + private static final String OCCURRENCE_ANNOTATION= "org.eclipse.cdt.ui.occurrences"; + private static final RGB fgHighlightRGB= getHighlightRGB(); + + private CEditor fEditor; + private IDocument fDocument; + private FindReplaceDocumentAdapter fFindReplaceDocumentAdapter; + private int fOccurrences; + private IAnnotationModel fAnnotationModel; + private ISelectionListenerWithAST fSelWASTListener; + private IRegion fMatch; + private StyledText fTextWidget; + + private MarkOccurrenceTestSetup fProjectSetup; + + protected static class MarkOccurrenceTestSetup extends TestSetup { + private ICProject fCProject; + + public MarkOccurrenceTestSetup(Test test) { + super(test); + } + protected void setUp() throws Exception { + super.setUp(); + fCProject= EditorTestHelper.createCProject(PROJECT, "resources/ceditor"); + } + protected void tearDown () throws Exception { + if (fCProject != null) + CProjectHelper.delete(fCProject); + + super.tearDown(); + } + } + + public static Test setUpTest(Test someTest) { + return new MarkOccurrenceTestSetup(someTest); + } + + public static Test suite() { + return setUpTest(new TestSuite(MarkOccurrenceTest.class)); + } + + protected void setUp() throws Exception { + if (!ResourcesPlugin.getWorkspace().getRoot().exists(new Path(PROJECT))) { + fProjectSetup= new MarkOccurrenceTestSetup(this); + fProjectSetup.setUp(); + } + assertNotNull(fgHighlightRGB); + CUIPlugin.getDefault().getPreferenceStore().setValue(PreferenceConstants.EDITOR_MARK_OCCURRENCES, true); + fEditor= openCEditor(new Path("/" + PROJECT + "/src/occurrences.cpp")); + assertNotNull(fEditor); + fTextWidget= fEditor.getViewer().getTextWidget(); + assertNotNull(fTextWidget); + fDocument= fEditor.getDocumentProvider().getDocument(fEditor.getEditorInput()); + assertNotNull(fDocument); + fFindReplaceDocumentAdapter= new FindReplaceDocumentAdapter(fDocument); + fAnnotationModel= fEditor.getDocumentProvider().getAnnotationModel(fEditor.getEditorInput()); + + fMatch= null; + fSelWASTListener= new ISelectionListenerWithAST() { + public void selectionChanged(IEditorPart part, ITextSelection selection, IASTTranslationUnit astRoot) { + if (fMatch != null && selection != null && selection.getOffset() == fMatch.getOffset() && selection.getLength() == fMatch.getLength()) { + countOccurrences(); + } + } + + private synchronized void countOccurrences() { + fOccurrences= 0; + Iterator iter= fAnnotationModel.getAnnotationIterator(); + while (iter.hasNext()) { + Annotation annotation= (Annotation)iter.next(); + if (OCCURRENCE_ANNOTATION.equals(annotation.getType())) + fOccurrences++; + } + } + }; + SelectionListenerWithASTManager.getDefault().addListener(fEditor, fSelWASTListener); + } + + /* + * @see junit.framework.TestCase#tearDown() + */ + protected void tearDown() throws Exception { + SelectionListenerWithASTManager.getDefault().removeListener(fEditor, fSelWASTListener); + EditorTestHelper.closeAllEditors(); + if (fProjectSetup != null) { + fProjectSetup.tearDown(); + } + } + + private CEditor openCEditor(IPath path) { + IFile file= ResourcesPlugin.getWorkspace().getRoot().getFile(path); + assertTrue(file != null && file.exists()); + try { + return (CEditor)EditorTestHelper.openInEditor(file, true); + } catch (PartInitException e) { + fail(); + return null; + } + } + + public void testMarkTypeOccurrences() { + try { + fMatch= fFindReplaceDocumentAdapter.find(0, "ClassContainer", true, true, true, false); + } catch (BadLocationException e) { + fail(); + } + assertNotNull(fMatch); + + fEditor.selectAndReveal(fMatch.getOffset(), fMatch.getLength()); + + assertOccurrences(3); + assertOccurrencesInWidget(); + } + + public void testMarkTypeOccurrences2() { + try { + fMatch= fFindReplaceDocumentAdapter.find(0, "Base1", true, true, true, false); + } catch (BadLocationException e) { + fail(); + } + assertNotNull(fMatch); + + fEditor.selectAndReveal(fMatch.getOffset(), fMatch.getLength()); + + assertOccurrences(3); + assertOccurrencesInWidget(); + } + + public void testMarkClassTemplateOccurrences() { + try { + fMatch= fFindReplaceDocumentAdapter.find(0, "TemplateClass", true, true, true, false); + } catch (BadLocationException e) { + fail(); + } + assertNotNull(fMatch); + + fEditor.selectAndReveal(fMatch.getOffset(), fMatch.getLength()); + + assertOccurrences(2); + assertOccurrencesInWidget(); + } + + public void testMarkTemplateParameterOccurrences() { + try { + fMatch= fFindReplaceDocumentAdapter.find(0, "T1", true, true, true, false); + } catch (BadLocationException e) { + fail(); + } + assertNotNull(fMatch); + + fEditor.selectAndReveal(fMatch.getOffset(), fMatch.getLength()); + + assertOccurrences(3); + assertOccurrencesInWidget(); + } + + public void testMarkTemplateIdOccurrences() { + try { + fMatch= fFindReplaceDocumentAdapter.find(0, "ConstantTemplate", true, true, true, false); + } catch (BadLocationException e) { + fail(); + } + assertNotNull(fMatch); + + fEditor.selectAndReveal(fMatch.getOffset(), fMatch.getLength()); + + assertOccurrences(4); + assertOccurrencesInWidget(); + } + + public void testMarkOccurrencesAfterEditorReuse() { + IPreferenceStore store= PlatformUI.getWorkbench().getPreferenceStore(); + store.setValue("REUSE_OPEN_EDITORS_BOOLEAN", true); + + int reuseOpenEditors= store.getInt("REUSE_OPEN_EDITORS"); + store.setValue("REUSE_OPEN_EDITORS", 1); + + SelectionListenerWithASTManager.getDefault().removeListener(fEditor, fSelWASTListener); + fEditor= openCEditor(new Path("/" + PROJECT + "/src/main.cpp")); + SelectionListenerWithASTManager.getDefault().addListener(fEditor, fSelWASTListener); + fDocument= fEditor.getDocumentProvider().getDocument(fEditor.getEditorInput()); + assertNotNull(fDocument); + fFindReplaceDocumentAdapter= new FindReplaceDocumentAdapter(fDocument); + fAnnotationModel= fEditor.getDocumentProvider().getAnnotationModel(fEditor.getEditorInput()); + + try { + fMatch= fFindReplaceDocumentAdapter.find(0, "main", true, true, false, false); + } catch (BadLocationException e) { + fail(); + } + assertNotNull(fMatch); + fMatch= new Region(fMatch.getOffset(), 4); + fEditor.selectAndReveal(fMatch.getOffset(), fMatch.getLength()); + + assertOccurrences(1); + assertOccurrencesInWidget(); + + store.setValue("REUSE_OPEN_EDITORS_BOOLEAN", false); + store.setValue("REUSE_OPEN_EDITORS", reuseOpenEditors); + } + + public void testMarkMethodOccurrences() { + try { + fMatch= fFindReplaceDocumentAdapter.find(0, "pubMethod", true, true, true, false); + } catch (BadLocationException e) { + fail(); + } + assertNotNull(fMatch); + + fEditor.selectAndReveal(fMatch.getOffset(), fMatch.getLength()); + + assertOccurrences(2); + assertOccurrencesInWidget(); + } + public void testMarkFieldOccurrences() { + try { + fMatch= fFindReplaceDocumentAdapter.find(0, "pubField", true, true, true, false); + } catch (BadLocationException e) { + fail(); + } + assertNotNull(fMatch); + + fEditor.selectAndReveal(fMatch.getOffset(), fMatch.getLength()); + + assertOccurrences(2); + assertOccurrencesInWidget(); + } + + public void testMarkLocalOccurrences() { + try { + fMatch= fFindReplaceDocumentAdapter.find(0, "localVar", true, true, true, false); + } catch (BadLocationException e) { + fail(); + } + assertNotNull(fMatch); + + fEditor.selectAndReveal(fMatch.getOffset(), fMatch.getLength()); + + assertOccurrences(2); + assertOccurrencesInWidget(); + } + + public void testMarkMacroOccurrences() { + try { + fMatch= fFindReplaceDocumentAdapter.find(0, "INT", true, true, true, false); + } catch (BadLocationException e) { + fail(); + } + assertNotNull(fMatch); + + fEditor.selectAndReveal(fMatch.getOffset(), fMatch.getLength()); + + assertOccurrences(5); + assertOccurrencesInWidget(); + } + + public void testMarkEnumeratorOccurrences() { + try { + fMatch= fFindReplaceDocumentAdapter.find(0, "ONE", true, true, true, false); + } catch (BadLocationException e) { + fail(); + } + assertNotNull(fMatch); + + fEditor.selectAndReveal(fMatch.getOffset(), fMatch.getLength()); + + assertOccurrences(2); + assertOccurrencesInWidget(); + } + + public void testNoOccurrencesIfDisabled() { + CUIPlugin.getDefault().getPreferenceStore().setValue(PreferenceConstants.EDITOR_MARK_OCCURRENCES, false); + fOccurrences= Integer.MAX_VALUE; + try { + fMatch= fFindReplaceDocumentAdapter.find(0, "Base1", true, true, true, false); + } catch (BadLocationException e) { + fail(); + } + assertNotNull(fMatch); + + fEditor.selectAndReveal(fMatch.getOffset(), fMatch.getLength()); + + assertOccurrences(0); + assertOccurrencesInWidget(); + } + + private void assertOccurrencesInWidget() { + EditorTestHelper.runEventQueue(500); + + Iterator iter= fAnnotationModel.getAnnotationIterator(); + while (iter.hasNext()) { + Annotation annotation= (Annotation)iter.next(); + if (OCCURRENCE_ANNOTATION.equals(annotation.getType())) + assertOccurrenceInWidget(fAnnotationModel.getPosition(annotation)); + } + } + + private void assertOccurrenceInWidget(Position position) { + StyleRange[] styleRanges= fTextWidget.getStyleRanges(position.offset, position.length); + for (int i= 0; i < styleRanges.length; i++) { + if (styleRanges[i].background != null) { + RGB rgb= styleRanges[i].background.getRGB(); + if (fgHighlightRGB.equals(rgb)) + return; + } + } + fail(); + + } + /** + * Returns the occurrence annotation color. + * + * @return the occurrence annotation color + */ + private static RGB getHighlightRGB() { + AnnotationPreference annotationPref= EditorsPlugin.getDefault().getAnnotationPreferenceLookup().getAnnotationPreference(OCCURRENCE_ANNOTATION); + IPreferenceStore store= EditorsUI.getPreferenceStore(); + if (store != null) + return PreferenceConverter.getColor(store, annotationPref.getColorPreferenceKey()); + + return null; + } + + + private void assertOccurrences(final int expected) { + DisplayHelper helper= new DisplayHelper() { + protected boolean condition() { + return fOccurrences == expected; + } + }; + if (!helper.waitForCondition(EditorTestHelper.getActiveDisplay(), 10000)) { + assertEquals(expected, fOccurrences); + } + } + +} diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/TextTestSuite.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/TextTestSuite.java index 9f8257c910e..d794ea94819 100644 --- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/TextTestSuite.java +++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/TextTestSuite.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2007 Wind River Systems, Inc. and others. + * Copyright (c) 2006, 2008 Wind River Systems, Inc. and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -46,6 +46,7 @@ public class TextTestSuite extends TestSuite { addTest(CHeaderRuleTest.suite()); addTest(NumberRuleTest.suite()); addTest(PairMatcherTest.suite()); + addTest(MarkOccurrenceTest.suite()); // folding tests addTest(FoldingTest.suite()); diff --git a/core/org.eclipse.cdt.ui/icons/dtool16/mark_occurrences.gif b/core/org.eclipse.cdt.ui/icons/dtool16/mark_occurrences.gif new file mode 100644 index 00000000000..1af4d3b30fd Binary files /dev/null and b/core/org.eclipse.cdt.ui/icons/dtool16/mark_occurrences.gif differ diff --git a/core/org.eclipse.cdt.ui/icons/etool16/mark_occurrences.gif b/core/org.eclipse.cdt.ui/icons/etool16/mark_occurrences.gif new file mode 100644 index 00000000000..fd7c1751c01 Binary files /dev/null and b/core/org.eclipse.cdt.ui/icons/etool16/mark_occurrences.gif differ diff --git a/core/org.eclipse.cdt.ui/icons/obj16/searchm_obj.gif b/core/org.eclipse.cdt.ui/icons/obj16/searchm_obj.gif new file mode 100644 index 00000000000..7b1efa5498f Binary files /dev/null and b/core/org.eclipse.cdt.ui/icons/obj16/searchm_obj.gif differ diff --git a/core/org.eclipse.cdt.ui/plugin.properties b/core/org.eclipse.cdt.ui/plugin.properties index f1b10514629..bc002fb1ff5 100644 --- a/core/org.eclipse.cdt.ui/plugin.properties +++ b/core/org.eclipse.cdt.ui/plugin.properties @@ -133,13 +133,14 @@ CPluginTemplatePreferencePage.name=Templates CPluginBuildConsolePreferencePage.name=Build Console CPluginFileTypesPreferencePage.name=File Types CodeFormatterPreferencePage.name=Code Style -codeTemplatePreferencePageName=Code Templates +codeTemplatePreferencePage.name=Code Templates CodeAssistPreferencePage.name=Content Assist CodeAssistAdvancedPreferencePage.name=Advanced SmartTypingPreferencePage.name=Typing ColoringPreferencePage.name=Syntax Coloring FoldingPreferencePage.name=Folding HoverPreferencePage.name=Hovers +markOccurrencesPreferencePage.name= Mark Occurrences DefaultBinaryFileEditor.name = Default Binary File Editor AsmEditor.name = Assembly Editor @@ -436,3 +437,10 @@ HelpInfo=Allows contributing the map files to the map-file-based CDT CHelpProvid # Macro Expansion Hover key binding context macroExpansionHoverScope.name= In Macro Expansion Hover macroExpansionHoverScope.description= In Macro Expansion Hover + +# Mark occurrences +toggleMarkOccurrences.label= Toggle Mark Occurrences +toggleMarkOccurrences.tooltip= Toggle Mark Occurrences +toggleMarkOccurrences.description= Toggles mark occurrences in C/C++ editors + +OccurrenceAnnotation.label= C/C++ Occurrences diff --git a/core/org.eclipse.cdt.ui/plugin.xml b/core/org.eclipse.cdt.ui/plugin.xml index d017763203e..fa05c7398bd 100644 --- a/core/org.eclipse.cdt.ui/plugin.xml +++ b/core/org.eclipse.cdt.ui/plugin.xml @@ -750,10 +750,15 @@ id="org.eclipse.cdt.ui.preferences.TodoTaskPreferencePage" name="%todoTaskPrefName"/> +