@Override
	protected boolean isEnabledForContext(ListingActionContext context) {
		if (context.hasSelection() || context.getAddress() == null) {
			return false;
		}
		ProgramLocation loc = context.getLocation();

		if (!(loc instanceof VariableLocation)) {
			return false;
		}
		VariableLocation varLoc = (VariableLocation) loc;
		Variable var = varLoc.getVariable();
		if (var == null || varLoc.isReturn()) {
			return false;
		}
		return true;
	}
Get a variable using the current location.
@param function the function
@return null if function is null or if current location is not
a stack variable location.
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/function/VariableCommentAction.java