Commits

Anonymous committed a347083

Added in_file rename config

  • Participants
  • Parent commits b02c5c3

Comments (0)

Files changed (2)

File docs/ropemacs.txt

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

File 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'