if (tlse instanceof SourceModel.TypeConstructorDefn.AlgebraicType){
SourceModel.TypeConstructorDefn.AlgebraicType at = (SourceModel.TypeConstructorDefn.AlgebraicType) tlse;
// This is a hacky way of finding out where the cursor is until the source model is richer.
final int nDataConstructors = at.getNDataConstructors();
for(int j = 0; j < nDataConstructors; ++j){
DataConsDefn dcd = at.getNthDataConstructor(j);
if (SourcePosition.compareByPosition.compare(dcd.getSourceRangeOfName().getStartSourcePosition(), pos) <= 0){
SourcePosition end = null;
if (dcd.getNTypeArgs() != 0){
// look for the position of the last arg
end = dcd.getNthTypeArg(dcd.getNTypeArgs()-1).getSourcePosition();
}
if (end == null){
// no args so just just the position of the end of the data cons.
end = dcd.getSourceRangeOfDefn().getEndSourcePosition();
}
if (SourcePosition.compareByPosition.compare(pos, end) <= 0){
return new SourceElement[] {tlse, dcd};
}