diff options
Diffstat (limited to 'subprojects/language-ide')
-rw-r--r-- | subprojects/language-ide/src/main/java/tools/refinery/language/ide/contentassist/ProblemCrossrefProposalProvider.java | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/subprojects/language-ide/src/main/java/tools/refinery/language/ide/contentassist/ProblemCrossrefProposalProvider.java b/subprojects/language-ide/src/main/java/tools/refinery/language/ide/contentassist/ProblemCrossrefProposalProvider.java index a09a475b..8b2542f3 100644 --- a/subprojects/language-ide/src/main/java/tools/refinery/language/ide/contentassist/ProblemCrossrefProposalProvider.java +++ b/subprojects/language-ide/src/main/java/tools/refinery/language/ide/contentassist/ProblemCrossrefProposalProvider.java | |||
@@ -125,6 +125,13 @@ public class ProblemCrossrefProposalProvider extends IdeCrossrefProposalProvider | |||
125 | return oppositeShouldBeVisible(candidateReferenceDeclaration, context); | 125 | return oppositeShouldBeVisible(candidateReferenceDeclaration, context); |
126 | } | 126 | } |
127 | 127 | ||
128 | if (eReference.equals(ProblemPackage.Literals.VARIABLE_OR_NODE_EXPR__VARIABLE_OR_NODE)) { | ||
129 | var assignedVariable = getAssignedVariable(context.getCurrentModel()); | ||
130 | if (assignedVariable != null && Objects.equals(assignedVariable, candidate.getEObjectOrProxy())) { | ||
131 | return false; | ||
132 | } | ||
133 | } | ||
134 | |||
128 | var builtinSymbolsOption = desugarer.getBuiltinSymbols(context.getRootModel()); | 135 | var builtinSymbolsOption = desugarer.getBuiltinSymbols(context.getRootModel()); |
129 | if (builtinSymbolsOption.isEmpty()) { | 136 | if (builtinSymbolsOption.isEmpty()) { |
130 | return true; | 137 | return true; |
@@ -135,6 +142,14 @@ public class ProblemCrossrefProposalProvider extends IdeCrossrefProposalProvider | |||
135 | candidateEObjectOrProxy); | 142 | candidateEObjectOrProxy); |
136 | } | 143 | } |
137 | 144 | ||
145 | private VariableOrNode getAssignedVariable(EObject context) { | ||
146 | var assignmentExpr = EcoreUtil2.getContainerOfType(context, AssignmentExpr.class); | ||
147 | if (assignmentExpr.getLeft() instanceof VariableOrNodeExpr variableOrNodeExpr) { | ||
148 | return variableOrNodeExpr.getVariableOrNode(); | ||
149 | } | ||
150 | return null; | ||
151 | } | ||
152 | |||
138 | private boolean importedModuleShouldBeVisible(IEObjectDescription candidate, ContentAssistContext context) { | 153 | private boolean importedModuleShouldBeVisible(IEObjectDescription candidate, ContentAssistContext context) { |
139 | var moduleKind = candidate.getUserData(ProblemResourceDescriptionStrategy.MODULE_KIND); | 154 | var moduleKind = candidate.getUserData(ProblemResourceDescriptionStrategy.MODULE_KIND); |
140 | if (!ModuleKind.MODULE.getName().equals(moduleKind)) { | 155 | if (!ModuleKind.MODULE.getName().equals(moduleKind)) { |