mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-10-01 09:03:31 +07:00
CommonDataflow#getExpressionRange contract
This commit is contained in:
@@ -297,8 +297,10 @@ public class CommonDataflow {
|
||||
* @param expression expression to get its range
|
||||
* @return long range set
|
||||
*/
|
||||
@Contract("null -> null")
|
||||
@Nullable
|
||||
public static LongRangeSet getExpressionRange(@Nullable PsiExpression expression) {
|
||||
if (expression == null) return null;
|
||||
Object value = ExpressionUtils.computeConstantExpression(expression);
|
||||
LongRangeSet rangeSet = LongRangeSet.fromConstant(value);
|
||||
if (rangeSet != null) return rangeSet;
|
||||
|
||||
Reference in New Issue
Block a user