Search in sources :

Example 1 with Position

use of lombok.ast.Position in project kotlin by JetBrains.

the class JavaContext method isSuppressedWithComment.

/**
     * @deprecated Use {@link #isSuppressedWithComment(PsiElement, Issue)} instead
     */
@Deprecated
public boolean isSuppressedWithComment(@NonNull Node scope, @NonNull Issue issue) {
    // Check whether there is a comment marker
    String contents = getContents();
    // otherwise we wouldn't be here
    assert contents != null;
    Position position = scope.getPosition();
    if (position == null) {
        return false;
    }
    int start = position.getStart();
    return isSuppressedWithComment(start, issue);
}
Also used : Position(lombok.ast.Position)

Example 2 with Position

use of lombok.ast.Position in project android by JetBrains.

the class LintIdeJavaParser method getRangeLocation.

@NonNull
@Override
public Location getRangeLocation(@NonNull JavaContext context, @NonNull Node from, int fromDelta, @NonNull Node to, int toDelta) {
    Position position1 = from.getPosition();
    Position position2 = to.getPosition();
    if (position1 == null) {
        return getLocation(context, to);
    } else if (position2 == null) {
        return getLocation(context, from);
    }
    int start = Math.max(0, from.getPosition().getStart() + fromDelta);
    int end = to.getPosition().getEnd() + toDelta;
    return Location.create(context.file, null, start, end);
}
Also used : Position(lombok.ast.Position) NonNull(com.android.annotations.NonNull)

Example 3 with Position

use of lombok.ast.Position in project kotlin by JetBrains.

the class IdeaJavaParser method getRangeLocation.

@Override
public Location getRangeLocation(@NonNull JavaContext context, @NonNull Node from, int fromDelta, @NonNull Node to, int toDelta) {
    Position position1 = from.getPosition();
    Position position2 = to.getPosition();
    if (position1 == null) {
        return getLocation(context, to);
    } else if (position2 == null) {
        return getLocation(context, from);
    }
    int start = Math.max(0, from.getPosition().getStart() + fromDelta);
    int end = to.getPosition().getEnd() + toDelta;
    return Location.create(context.file, null, start, end);
}
Also used : Position(lombok.ast.Position)

Aggregations

Position (lombok.ast.Position)3 NonNull (com.android.annotations.NonNull)1