addFeatures = function(tgtItem, feature, featureType, range, featureProperties) {
    // target item cannot have the same name as the feature name
    if (tgtItem.name === feature) {
        // Item must be defined before being added as a feature.
        let errorMsg = `Source and target cannot be the same for usesFeature. e.g. x usesFeature x  is invalid. "${tgtItem.name}" usesFeature "${feature}" is invalid.`;
        let error = BuildDiagnostic({
            message: errorMsg,
            range: range
        })
        throw (new exception(retCode.errorCode.INVALID_INPUT, error.toString(), [error]));
    }
    let featureAlreadyDefined = (tgtItem.features || []).find(item => item.modelName == feature || item.featureName == feature);
    switch (featureType) {
        case featureTypeEnum.featureToModel: {
            if (tgtItem.features) {
                if (!featureAlreadyDefined) tgtItem.features.push(new helperClass.featureToModel(feature, featureProperties));
            } else {
                tgtItem.features = new Array(new helperClass.featureToModel(feature, featureProperties));
            }
            break;
        }
        case featureTypeEnum.modelToFeature: {
            if (tgtItem.features) {
                if (!featureAlreadyDefined) tgtItem.features.push(new helperClass.modelToFeature(feature, featureProperties));
            } else {
                tgtItem.features = new Array(new helperClass.modelToFeature(feature, featureProperties));
            }
            break;
        }
        default: 
            break;
    }
}
Helper function to add features to the parsed content scope.
@param {Object} tgtItem 
@param {String} feature 
@param {String} featureType 
@param {Object} range