validateFeatureAssignment = function(srcItemType, srcItemName, tgtFeatureType, tgtFeatureName, range) {
    switch(srcItemType) {
        case INTENTTYPE:
        case EntityTypeEnum.SIMPLE:
        case EntityTypeEnum.ML:
        case EntityTypeEnum.COMPOSITE:
            // can use everything as a feature except pattern.any
            if (tgtFeatureType === EntityTypeEnum.PATTERNANY) {
                let errorMsg = `'patternany' entity cannot be added as a feature. Invalid definition found for "@ ${srcItemType} ${srcItemName} usesFeature ${tgtFeatureName}"`;
                let error = BuildDiagnostic({
                    message: errorMsg,
                    range: range
                })
                throw (new exception(retCode.errorCode.INVALID_INPUT, error.toString(), [error]));
            }
            break;
        default:
            // cannot have any features assigned
            let errorMsg = `Invalid definition found for "@ ${srcItemType} ${srcItemName} usesFeature ${tgtFeatureName}". usesFeature is only available for intent, ${plAllowedTypes.join(', ')}`;
            let error = BuildDiagnostic({
                message: errorMsg,
                range: range
            })
            throw (new exception(retCode.errorCode.INVALID_INPUT, error.toString(), [error]));
            break;
    }
}
Helper function to validate if the requested feature addition is valid.
@param {String} srcItemType 
@param {String} srcItemName 
@param {String} tgtFeatureType 
@param {String} tgtFeatureName 
@param {Range} range