public Iterator<Function> getFunctions(ListingActionContext context) {
		ProgramSelection selection = context.getSelection();
		Program program = context.getProgram();
		ProgramLocation location = context.getLocation();
		if (selection != null && !selection.isEmpty()) {
			return program.getFunctionManager().getFunctionsOverlapping(selection);
		}
		if (location != null) {
			Address loc = location.getAddress();
			return program.getFunctionManager().getFunctionsOverlapping(new AddressSet(loc, loc));
		}
		return Collections.emptyIterator();
	}
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