Anonymous avatar 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):
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.