Anonymous avatar Anonymous committed a347083

Added in_file rename config

Comments (0)

Files changed (2)

docs/ropemacs.txt

   * Code-completion
   * Goto definition
   * Show pydoc
+  * Find occurrences
   * Organize imports (remove unused and duplicate imports and sort them)
   * Generating python elements
 

ropemacs/refactor.py

     name = 'rename'
     key = 'C-c r r'
     optionals = {
-        'docs': dialog.Data('Rename occurrences in comments and docs: ', values=['yes', 'no']),
-        'in_hierarchy': dialog.Data('Method in class hierarchy: ', values=['yes', 'no']),
-        'unsure': dialog.Data('Unsure occurrences: ', values=['ignore', 'match'])}
+        'docs': dialog.Data('Rename occurrences in comments and docs: ',
+                            values=['yes', 'no'], default='yes'),
+        'in_hierarchy': dialog.Data('Method in class hierarchy: ',
+                                    values=['yes', 'no'], default='no'),
+        'in_file': dialog.Data('Only rename occurrences in the same file: ',
+                               values=['yes', 'no'], default='no'),
+        'unsure': dialog.Data('Unsure occurrences: ',
+                              values=['ignore', 'match'], default='ignore')}
     saveall = True
 
     def __init__(self, interface):
 
     def _calculate_changes(self, values, task_handle):
         newname = values['newname']
-        unsure = values.get('unsure', 'no') == 'yes'
+        unsure = values.get('unsure', 'ignore') == 'match'
         kwds = {
             'docs': values.get('docs', 'yes') == 'yes',
+            'in_file': values.get('in_file', 'no') == 'yes',
             'unsure': (lambda occurrence: unsure)}
         if self.renamer.is_method():
             kwds['in_hierarchy'] = values.get('in_hierarchy', 'no') == 'yes'
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.