
org.jnario.formatter.JnarioNodeModelAccess.xtend Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of org.jnario.standalone Show documentation
Show all versions of org.jnario.standalone Show documentation
The required libraries to execute Jnario specifications without Eclipse.
The newest version!
package org.jnario.formatter
import org.eclipse.emf.ecore.EObject
import org.eclipse.xtext.Keyword
import org.eclipse.xtext.nodemodel.ILeafNode
import org.eclipse.xtext.nodemodel.util.NodeModelUtils
import org.eclipse.xtext.xbase.formatting.NodeModelAccess
class JnarioNodeModelAccess extends NodeModelAccess{
override nodesForKeyword(EObject obj, String kw) {
val node = NodeModelUtils.findActualNodeFor(obj)
if(node == null){
return #[]
}
val leafNode = node.asTreeIterable.findFirst[semanticElement == obj && grammarElement instanceof Keyword && text == kw] as ILeafNode
if (leafNode === null) #[] else #[leafNode]
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy