mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-10-06 06:21:16 +07:00
LineMarkerProvider: javadoc formatting
This commit is contained in:
@@ -27,27 +27,32 @@ import java.util.List;
|
||||
* @author yole
|
||||
*/
|
||||
public interface LineMarkerProvider {
|
||||
@Nullable
|
||||
/**
|
||||
* Get line markers for this PsiElement.
|
||||
*
|
||||
* <p/>
|
||||
* NOTE for implementers:
|
||||
* Please return line marker info for exact element you were asked for.
|
||||
* For example, do not return class marker info if getLineMarkerInfo() was called for a method.
|
||||
* For example, do not return class marker info if getLineMarkerInfo() was called for a method.
|
||||
* Please return relevant line marker info for as small element as possible.
|
||||
* For example, do not return method marker for PsiMethod. Instead, return it for the PsiIdentifier which is a name of this method.
|
||||
*
|
||||
* For example, do not return method marker for PsiMethod. Instead, return it for the PsiIdentifier which is a name of this method.
|
||||
* <p/>
|
||||
* More technical details:
|
||||
* Inspection (specifically, LineMarkersPass) for performance reasons queries all LineMarkerProviders in two passes:
|
||||
* - first pass for all elements in visible area
|
||||
* - second pass for all the rest elements
|
||||
* If providers return nothing for either area, its line markers are cleared.
|
||||
* So if, for example a method, is half-visible (e.g. its name is visible but a part of its body isn't) and
|
||||
* some poorly written LineMarkerProvider returns info for the PsiMethod instead of PsiIdentifier then following happens:
|
||||
* - the first pass removes line marker info because whole PsiMethod is not visible.
|
||||
* - the second pass tries to add line marker info back because LineMarkerProvider is called for the PsiMethod at last.
|
||||
* As a result, line marker icon blinks annoyingly.
|
||||
* Inspection (specifically, LineMarkersPass) for performance reasons queries all LineMarkerProviders in two passes:
|
||||
* <ul>
|
||||
* <li>first pass for all elements in visible area</li>
|
||||
* <li>second pass for all the rest elements</li>
|
||||
* </ul>
|
||||
* If providers return nothing for either area, its line markers are cleared.
|
||||
* <p/>
|
||||
* So if, for example a method, is half-visible (e.g. its name is visible but a part of its body isn't) and
|
||||
* some poorly written LineMarkerProvider returns info for the PsiMethod instead of PsiIdentifier then following happens:
|
||||
* <ul>
|
||||
* <li>the first pass removes line marker info because whole PsiMethod is not visible</li>
|
||||
* <li>the second pass tries to add line marker info back because LineMarkerProvider is called for the PsiMethod at last</li>
|
||||
* </ul>
|
||||
* As a result, line marker icon blinks annoyingly.
|
||||
*/
|
||||
@Nullable
|
||||
LineMarkerInfo getLineMarkerInfo(@NotNull PsiElement element);
|
||||
|
||||
void collectSlowLineMarkers(@NotNull List<PsiElement> elements, @NotNull Collection<LineMarkerInfo> result);
|
||||
|
||||
Reference in New Issue
Block a user