mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
GuessManagerImpl: do not run DFA if assignment right-hands have the same type as left-hands
Fixes IDEA-185290 Too long time takes filling of Ctrl+Space list. (fast code insertion)
This commit is contained in:
+6
-2
@@ -174,13 +174,16 @@ public class GuessManagerImpl extends GuessManager {
|
||||
}
|
||||
}
|
||||
if (place == null) return false;
|
||||
PsiType type = place.getType();
|
||||
if (type == null) return false;
|
||||
final int start = place.getTextRange().getStartOffset();
|
||||
class Visitor extends JavaRecursiveElementWalkingVisitor {
|
||||
public boolean hasInteresting;
|
||||
|
||||
@Override
|
||||
public void visitAssignmentExpression(PsiAssignmentExpression expression) {
|
||||
if (ExpressionTypeMemoryState.EXPRESSION_HASHING_STRATEGY.equals(expression.getLExpression(), place)) {
|
||||
if (ExpressionTypeMemoryState.EXPRESSION_HASHING_STRATEGY.equals(expression.getLExpression(), place) &&
|
||||
expression.getRExpression() != null && !type.equals(expression.getRExpression().getType())) {
|
||||
hasInteresting = true;
|
||||
stopWalking();
|
||||
}
|
||||
@@ -189,7 +192,8 @@ public class GuessManagerImpl extends GuessManager {
|
||||
|
||||
@Override
|
||||
public void visitLocalVariable(PsiLocalVariable variable) {
|
||||
if (variable.getInitializer() != null && ExpressionUtils.isReferenceTo(place, variable)) {
|
||||
if (variable.getInitializer() != null && ExpressionUtils.isReferenceTo(place, variable) &&
|
||||
!type.equals(variable.getInitializer().getType())) {
|
||||
hasInteresting = true;
|
||||
stopWalking();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user