mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
yet another API for advertising in completion
This commit is contained in:
+1
-1
@@ -81,7 +81,7 @@ public class DefaultCodeFragmentFactory extends CodeFragmentFactory {
|
||||
|
||||
if (parameters.getInvocationCount() <= 1 && JavaCompletionUtil.mayHaveSideEffects(expression)) {
|
||||
final CompletionService service = CompletionService.getCompletionService();
|
||||
if (service.getAdvertisementText() == null && parameters.getInvocationCount() < 2) {
|
||||
if (parameters.getInvocationCount() < 2) {
|
||||
service.setAdvertisementText("Invoke completion once more to see runtime type variants");
|
||||
}
|
||||
return null;
|
||||
|
||||
+3
-3
@@ -265,13 +265,13 @@ public class JavaCompletionContributor extends CompletionContributor {
|
||||
}
|
||||
});
|
||||
} else {
|
||||
advertiseSecondCompletion(parameters.getPosition().getProject());
|
||||
advertiseSecondCompletion(parameters.getPosition().getProject(), result);
|
||||
}
|
||||
}
|
||||
|
||||
public static void advertiseSecondCompletion(Project project) {
|
||||
public static void advertiseSecondCompletion(Project project, CompletionResultSet result) {
|
||||
if (FeatureUsageTracker.getInstance().isToBeAdvertisedInLookup(CodeCompletionFeatures.SECOND_BASIC_COMPLETION, project)) {
|
||||
CompletionService.getCompletionService().setAdvertisementText("Press " + getActionShortcut(IdeActions.ACTION_CODE_COMPLETION) + " to see non-imported classes");
|
||||
result.addLookupAdvertisement("Press " + getActionShortcut(IdeActions.ACTION_CODE_COMPLETION) + " to see non-imported classes");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -98,7 +98,7 @@ public abstract class StaticMemberProcessor {
|
||||
}
|
||||
|
||||
private void showHint(boolean shouldImport) {
|
||||
if (!myHintShown && !shouldImport && CompletionService.getCompletionService().getAdvertisementText() == null) {
|
||||
if (!myHintShown && !shouldImport) {
|
||||
final String shortcut = CompletionContributor.getActionShortcut(IdeActions.ACTION_SHOW_INTENTION_ACTIONS);
|
||||
if (shortcut != null) {
|
||||
CompletionService.getCompletionService().setAdvertisementText("To import a method statically, press " + shortcut);
|
||||
|
||||
Reference in New Issue
Block a user