no references to class name completion from productivity tips (IDEA-86517)

This commit is contained in:
peter
2012-06-27 18:06:22 +02:00
parent 37e35440ac
commit b5ea366ab8
16 changed files with 8 additions and 103 deletions
@@ -105,11 +105,10 @@ public class ConstructorInsertHandler implements InsertHandler<LookupElementDeco
return;
}
if (mySmart) {
FeatureUsageTracker.getInstance().triggerFeatureUsed(JavaCompletionFeatures.AFTER_NEW);
}
if (isAbstract) {
if (mySmart) {
FeatureUsageTracker.getInstance().triggerFeatureUsed(JavaCompletionFeatures.AFTER_NEW_ANONYMOUS);
}
PostprocessReformattingAspect.getInstance(context.getProject()).doPostponedFormatting(context.getFile().getViewProvider());
final Editor editor = context.getEditor();
@@ -53,11 +53,6 @@ public class JavaClassNameCompletionContributor extends CompletionContributor {
@Override
public void fillCompletionVariants(CompletionParameters parameters, final CompletionResultSet _result) {
if (parameters.isExtendedCompletion()) {
if (shouldShowSecondSmartCompletionHint(parameters) &&
CompletionUtil.shouldShowFeature(parameters, CodeCompletionFeatures.SECOND_CLASS_NAME_COMPLETION)) {
CompletionService.getCompletionService().setAdvertisementText(CompletionBundle.message("completion.class.name.hint.2", getActionShortcut(IdeActions.ACTION_CODE_COMPLETION)));
}
CompletionResultSet result = _result.withPrefixMatcher(CompletionUtil.findReferenceOrAlphanumericPrefix(parameters));
addAllClasses(parameters, parameters.getInvocationCount() <= 1,
JavaCompletionSorting.addJavaSorting(parameters, result).getPrefixMatcher(), new Consumer<LookupElement>() {
@@ -488,15 +488,6 @@ public class JavaCompletionContributor extends CompletionContributor {
}
}
if (parameters.getCompletionType() != CompletionType.CLASS_NAME && shouldSuggestClassNameCompletion(parameters.getPosition())) {
if (CompletionUtil.shouldShowFeature(parameters, CodeCompletionFeatures.EDITING_COMPLETION_CLASSNAME)) {
final String shortcut = getActionShortcut(IdeActions.ACTION_CODE_COMPLETION);
if (shortcut != null) {
return CompletionBundle.message("completion.class.name.hint", shortcut);
}
}
}
if (parameters.getCompletionType() == CompletionType.SMART && parameters.getInvocationCount() == 1) {
final PsiType[] psiTypes = ExpectedTypesGetter.getExpectedTypes(parameters.getPosition(), true);
if (psiTypes.length > 0) {
@@ -27,5 +27,4 @@ public interface JavaCompletionFeatures {
@NonNls String SECOND_SMART_COMPLETION_ARRAY_MEMBER = "editing.completion.second.smarttype.array.member";
@NonNls String GLOBAL_MEMBER_NAME = "editing.completion.global.member.name";
@NonNls String AFTER_NEW = "editing.completion.smarttype.afternew";
@NonNls String AFTER_NEW_ANONYMOUS = "editing.completion.smarttype.afternew";
}