Commits

Anonymous committed 1193c19

Using Courier font for status bar
Not auto-completing only words after dots

Comments (0)

Files changed (4)

docs/workingon.txt

 - Not proposing builtins and keywords when starting is empty
 - Should we have both function and method?
+- Setting better font for status bar
+- Not auto completing only the words after dot
 
+? What to do after dots?
 ? Sorting the proposals
-? What to do after dots?
 ? Completions are context dependant
 
 ? Separating ui modules and packages
     ? Specifing the type of each story; UI or Core
 ? The connection between ASTs, module hierarchies and type databases
 * Better font selection on windows
+? Key selection for new module and package
+

rope/codeassist.py

     def _find_starting_offset(self, source_code, offset):
         current_offset = offset - 1
         while current_offset >= 0 and (source_code[current_offset].isalnum() or
-                                       source_code[current_offset] == '_'):
+                                       source_code[current_offset] in '_.'):
             current_offset -= 1;
         return current_offset + 1
 

rope/statusbar.py

     def create_status(self, kind):
         if self.status_text.has_key(kind):
             raise StatusBarException('StatusText <%s> already exists' % kind)
-        label = Label(self.status_bar, text=' ', height=1, relief=RIDGE)
+        label = Label(self.status_bar, text=' ', height=1,
+                      relief=RIDGE, font=('Courier', 12))
         self.status_text[kind] = StatusText(self, kind, label)
         label.pack(side=LEFT)
         self.status_text[kind].set_text('')

ropetest/codeassisttest.py

         for proposal in result.proposals:
             if proposal.completion == completion and proposal.kind == kind:
                 return
-        self.fail('Completion %s not proposed' % completion)
+        self.fail('completion <%s> not proposed' % completion)
 
     def assert_proposal_not_in_result(self, completion, kind, result):
         for proposal in result.proposals:
             if proposal.completion == completion and proposal.kind == kind:
-                self.fail('Completion %s was proposed' % completion)
+                self.fail('completion <%s> was proposed' % completion)
 
     def test_completing_global_variables(self):
         code = 'my_global = 10\nt = my'
         result = self.assist.complete_code(code, len(code))
         self.assert_proposal_in_result('for', 'keyword', result)
 
+    def test_not_reporting_proposals_after_dot(self):
+        code = 'a_dict = {}\nkey = 3\na_dict.ke'
+        result = self.assist.complete_code(code, len(code))
+        self.assert_proposal_not_in_result('key', 'global_variable', result)
+
 
 if __name__ == '__main__':
     unittest.main()