diff options
author | Tor Norbye <tnorbye@google.com> | 2014-08-21 00:31:02 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2014-08-16 04:55:08 +0000 |
commit | 9cde0e3c015174898df8b8f3672185941fad4786 (patch) | |
tree | 80a55c7b59c38377216daaada4e8bc47b69ceb9a /python/src/com/jetbrains/python/refactoring/PyReplaceExpressionUtil.java | |
parent | 3b37877a2561bf9fbe072253a18688807d523505 (diff) | |
parent | d76e3920c56d37c942092b7dca20fcaded81c0a5 (diff) | |
download | idea-9cde0e3c015174898df8b8f3672185941fad4786.tar.gz |
Merge "Merge remote-tracking branch 'aosp/upstream-master' into merge"
Diffstat (limited to 'python/src/com/jetbrains/python/refactoring/PyReplaceExpressionUtil.java')
-rw-r--r-- | python/src/com/jetbrains/python/refactoring/PyReplaceExpressionUtil.java | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/python/src/com/jetbrains/python/refactoring/PyReplaceExpressionUtil.java b/python/src/com/jetbrains/python/refactoring/PyReplaceExpressionUtil.java index f4cb9e6a73f3..2cebb3ec2720 100644 --- a/python/src/com/jetbrains/python/refactoring/PyReplaceExpressionUtil.java +++ b/python/src/com/jetbrains/python/refactoring/PyReplaceExpressionUtil.java @@ -47,6 +47,15 @@ import static com.jetbrains.python.inspections.PyStringFormatParser.parsePercent * @author Dennis.Ushakov */ public class PyReplaceExpressionUtil implements PyElementTypes { + /** + * This marker is added in cases where valid selection nevertheless breaks existing expression. + * It can happen in cases like (here {@code <start> and <end>} represent selection boundaries): + * <ul> + * <li>Selection conflicts with operator precedence: {@code n = 1 * <start>2 + 3<end>}</li> + * <li>Selection conflicts with operator associativity: {@code n = 1 + <start>2 + 3<end>}</li> + * <li>Part of string literal is selected: {@code s = 'green <start>eggs<end> and ham'}</li> + * </ul> + */ public static final Key<Pair<PsiElement, TextRange>> SELECTION_BREAKS_AST_NODE = new Key<Pair<PsiElement, TextRange>>("python.selection.breaks.ast.node"); |