1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-07 17:56:01 +02:00

Bug 328638: Matching qualified names in quick outline, by Marc-Andre Laperle.

This commit is contained in:
Markus Schorn 2010-11-04 11:07:46 +00:00
parent 279038ad18
commit 12d516a0fb

View file

@ -12,6 +12,9 @@
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.internal.ui.text; package org.eclipse.cdt.internal.ui.text;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.eclipse.core.commands.Command; import org.eclipse.core.commands.Command;
import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.CoreException;
import org.eclipse.jface.action.IMenuManager; import org.eclipse.jface.action.IMenuManager;
@ -77,6 +80,7 @@ import org.eclipse.cdt.internal.ui.util.StringMatcher;
*/ */
public abstract class AbstractInformationControl extends PopupDialog implements IInformationControl, IInformationControlExtension, IInformationControlExtension2, DisposeListener { public abstract class AbstractInformationControl extends PopupDialog implements IInformationControl, IInformationControlExtension, IInformationControlExtension2, DisposeListener {
private final String COLON_COLON = String.valueOf(Keywords.cpCOLONCOLON); private final String COLON_COLON = String.valueOf(Keywords.cpCOLONCOLON);
private final Pattern PATTERN_COLON_COLON = Pattern.compile(COLON_COLON);
/** /**
* The NamePatternFilter selects the elements which * The NamePatternFilter selects the elements which
@ -716,11 +720,13 @@ public abstract class AbstractInformationControl extends PopupDialog implements
if (matcher.match(name)) if (matcher.match(name))
return true; return true;
// Check last segment of a qualified name Matcher match = PATTERN_COLON_COLON.matcher(name);
int idx= name.lastIndexOf(COLON_COLON); while(match.find()) {
if (idx >= 0 && matcher.match(name.substring(idx+COLON_COLON.length()))) int idx = match.start();
return true; if (matcher.match(name.substring(idx+COLON_COLON.length())))
return true;
}
return false; return false;
} }
} }