This didn't work due to a quirk in Pry::CodeObject.lookup() which purposely ignores 'expressions'
as they can be methods, which are dangerous to lookup. We now make an exception when the expression is 'self'
This code needs to be refactored as we have ridiculosu method names like `def variable_or_constant_or_self?`
and we have methods like this in a couple of places. Refactor pls.
This is so that Pry::CodeObject can return Pry::ClassCommand objects directly, this is impt
as we want slightly different behaviour than just Pry::WrappedModule(command_class), notably .doc should return
command help rather than comments above the command's class definition.
Pry::CodeObject::Helpers mixin provides the following methods:
command?
module_with_yard_docs?
real_method_object?
c_method?
which are then mixed into the code objects: Pry::Command, Pry::Method, Pry::WrappedModule, Pry::WrappedModule::Candidate
the '#' used to be interpreted as a comment and so only 'local' and not the associated method was looked up.
Fixed this by letting strings of the form /\S#\S/ pass through to Pry::Method lookup