protected DataType getCurrentDataType(ListingActionContext context) {
		Program program = context.getProgram();
		ProgramLocation loc = context.getLocation();
		if (loc instanceof FunctionParameterFieldLocation) {
			Parameter parm = ((FunctionParameterFieldLocation) loc).getParameter();
			return parm.getFormalDataType();
		}
		if (loc instanceof FunctionSignatureFieldLocation) {
			Address funcEntry = ((FunctionSignatureFieldLocation) loc).getFunctionAddress();
			Function fun = program.getFunctionManager().getFunctionAt(funcEntry);
			return fun.getReturn().getFormalDataType();
		}
		if (loc instanceof VariableLocation) {
			Variable var = ((VariableLocation) loc).getVariable();
			if (var instanceof Parameter) {
				return ((Parameter) var).getFormalDataType();
			}
			return var.getDataType();
		}
		return null;
	}
Get an iterator over all functions overlapping the current selection.
If there is no selection any functions overlapping the current location.

@param context the context 
@return Iterator over functions
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/function/FunctionPlugin.java