Skip to content

Commit

Permalink
use scopes from MPS
Browse files Browse the repository at this point in the history
  • Loading branch information
slisson committed Dec 16, 2023
1 parent c3bc89b commit 52130a2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -331,10 +331,10 @@ class ReferenceCellTemplate(
private fun getTargetNode(sourceNode: INode): INode? {
return sourceNode.getReferenceTarget(link)
}
override fun getInstantiationActions(location: INonExistingNode, parameters: CodeCompletionParameters): List<IActionOrProvider>? {
val specializedLocation = location.ofSubConcept(concept)
val scope = ScopeAspect.getScope(specializedLocation, link)
val targets = scope.getVisibleElements(specializedLocation, link)
override fun getInstantiationActions(location: INonExistingNode, parameters: CodeCompletionParameters): List<IActionOrProvider> {
val sourceNode = NonExistingChild(location.getParent()!!, location.getContainmentLink()!!, location.index()).ofSubConcept(concept)
val scope = ScopeAspect.getScope(sourceNode, link)
val targets = scope.getVisibleElements(sourceNode, link)
return targets.map { target ->
val text = when (target) {
is ExistingNode -> presentation(target.getNode()) ?: ""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import org.modelix.aspects.ILanguageAspectFactory
import org.modelix.aspects.LanguageAspectsBuilder
import org.modelix.aspects.getInstance
import org.modelix.editor.INonExistingNode
import org.modelix.editor.NonExistingNode
import org.modelix.editor.toNonExisting
import org.modelix.metamodel.ITypedNode
import org.modelix.metamodel.ITypedReferenceLink
Expand Down

0 comments on commit 52130a2

Please sign in to comment.