Commits

Anonymous committed 13212d7

inline: updated docs about InlineParameter

Comments (0)

Files changed (1)

rope/refactor/inline.py

 def create_inline(project, resource, offset):
     """Create a refactoring object for inlining
 
-    Based on `resource` and `offset` will return an `InlineMethod` or
-    an `InlineVariable` object.
+    Based on `resource` and `offset` it returns an instance of
+    `InlineMethod`, `InlineVariable` or `InlineParameter`.
 
     """
     pycore = project.pycore
     this_pymodule = pycore.resource_to_pyobject(resource)
     pyname = evaluate.get_pyname_at(this_pymodule, offset)
+    message = 'Inline refactoring should be performed on ' \
+              'a method, local variable or parameter.'
     if pyname is None:
-        raise rope.base.exceptions.RefactoringError(
-            'Inline refactoring should be performed on a method/local variable.')
+        raise rope.base.exceptions.RefactoringError(message)
     if isinstance(pyname, pynames.AssignedName):
         return InlineVariable(project, resource, offset)
     if isinstance(pyname, pynames.ParameterName):
     if isinstance(pyname.get_object(), pyobjects.PyFunction):
         return InlineMethod(project, resource, offset)
     else:
-        raise rope.base.exceptions.RefactoringError(
-            'Inline refactoring should be performed on a method/local variable.')
+        raise rope.base.exceptions.RefactoringError(message)
 
 
 class _Inliner(object):