Skip to content

Instantly share code, notes, and snippets.

@kthoms
Created March 25, 2013 20:33
Show Gist options
  • Save kthoms/5240455 to your computer and use it in GitHub Desktop.
Save kthoms/5240455 to your computer and use it in GitHub Desktop.
LWC13: QlDslXtendValidator.xtend check_featureDeclaredBeforeCall
@Check
def void check_featureDeclaredBeforeCall (XFeatureCall featureCall) {
val featureSource = featureCall.feature.sourceElements.head
val nodeFeature = if (featureSource != null) featureSource.node else featureCall.feature.node
val nodeCall = featureCall.node
if (nodeFeature != null) {
if (nodeFeature.offset > nodeCall.offset) {
error(featureCall.feature.simpleName+" must be declared before.",featureCall,
XbasePackage::eINSTANCE.XAbstractFeatureCall_Feature, IssueCodes::FEATURE_CALL_BEFORE_DECLARATION, null
)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment