mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Add/Cleanup Javadoc for RunLineMarkerContributor
GitOrigin-RevId: 654172d682bad95cceae752fffa729ccb4b80d63
This commit is contained in:
committed by
intellij-monorepo-bot
parent
cefb31e756
commit
647f72fc68
+17
-2
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.execution.lineMarker;
|
||||
|
||||
import com.intellij.execution.ExecutionBundle;
|
||||
@@ -20,11 +20,18 @@ import java.util.Arrays;
|
||||
import java.util.Objects;
|
||||
import java.util.function.Function;
|
||||
|
||||
/**
|
||||
* Allows adding an editor gutter icon associated with a PSI element that can be run
|
||||
* (e.g., a test, a main method, an application, etc.).
|
||||
*/
|
||||
public abstract class RunLineMarkerContributor {
|
||||
public static final Function<PsiElement, String> RUN_TEST_TOOLTIP_PROVIDER = it -> ExecutionBundle.message("run.text");
|
||||
|
||||
static final LanguageExtension<RunLineMarkerContributor> EXTENSION = new LanguageExtension<>("com.intellij.runLineMarkerContributor");
|
||||
|
||||
/**
|
||||
* Creates test run line marker info with a given icon and available executor actions.
|
||||
*/
|
||||
@NotNull
|
||||
public static Info withExecutorActions(@NotNull Icon icon) {
|
||||
return new Info(icon, ExecutorAction.getActions(1), RUN_TEST_TOOLTIP_PROVIDER);
|
||||
@@ -71,16 +78,24 @@ public abstract class RunLineMarkerContributor {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns information about gutter icon, its tooltip, and available run actions for a given PSI element.
|
||||
*/
|
||||
@Nullable
|
||||
public abstract Info getInfo(@NotNull PsiElement element);
|
||||
|
||||
/**
|
||||
* Returns information about gutter icon, its tooltip, and available run actions for a given PSI element.
|
||||
* Implement if creating the information is slow.
|
||||
* @see com.intellij.codeInsight.daemon.LineMarkerProvider#collectSlowLineMarkers
|
||||
*/
|
||||
public Info getSlowInfo(@NotNull PsiElement element) {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param file any file with a language this contributor is registered for
|
||||
* @return whether there's no possibility that a {@link com.intellij.execution.actions.RunConfigurationProducer}'would
|
||||
* @return whether there's no possibility that a {@link com.intellij.execution.actions.RunConfigurationProducer} would
|
||||
* return a configuration not returned by this contributor in this file. Used to speed up "Run..." context action update.
|
||||
*/
|
||||
public boolean producesAllPossibleConfigurations(@NotNull PsiFile file) {
|
||||
|
||||
Reference in New Issue
Block a user