24 # Start-Of-Header |
24 # Start-Of-Header |
25 name = "Refactoring Rope Plugin" |
25 name = "Refactoring Rope Plugin" |
26 author = "Detlev Offenbach <detlev@die-offenbachs.de>" |
26 author = "Detlev Offenbach <detlev@die-offenbachs.de>" |
27 autoactivate = True |
27 autoactivate = True |
28 deactivateable = True |
28 deactivateable = True |
29 version = "4.0.5" |
29 version = "4.0.6" |
30 className = "RefactoringRopePlugin" |
30 className = "RefactoringRopePlugin" |
31 packageName = "RefactoringRope" |
31 packageName = "RefactoringRope" |
32 internalPackages = "rope" |
32 internalPackages = "rope" |
33 shortDescription = "Refactoring using the Rope library." |
33 shortDescription = "Refactoring using the Rope library." |
34 longDescription = """This plug-in implements refactoring functionality""" \ |
34 longDescription = """This plug-in implements refactoring functionality""" \ |
504 from QScintilla.Editor import EditorAutoCompletionListID |
504 from QScintilla.Editor import EditorAutoCompletionListID |
505 |
505 |
506 if self.__currentEditor is not None: |
506 if self.__currentEditor is not None: |
507 if self.__currentEditor.isListActive(): |
507 if self.__currentEditor.isListActive(): |
508 self.__currentEditor.cancelList() |
508 self.__currentEditor.cancelList() |
509 completions = self.__caObject.getCompletions(self.__currentEditor) |
509 completions = self.getCompletionsList(self.__currentEditor, False) |
510 if len(completions) == 0 and \ |
510 if len(completions) == 0 and \ |
511 self.getPreferences("ShowQScintillaCompletions"): |
511 self.getPreferences("ShowQScintillaCompletions"): |
512 # try QScintilla autocompletion |
512 # try QScintilla autocompletion |
513 self.__currentEditor.autoCompleteQScintilla() |
513 self.__currentEditor.autoCompleteQScintilla() |
514 else: |
514 else: |
515 completions.sort() |
515 completions.sort() |
516 self.__currentEditor.showUserList(EditorAutoCompletionListID, |
516 self.__currentEditor.showUserList(EditorAutoCompletionListID, |
517 completions) |
517 completions) |
|
518 |
|
519 def getCompletionsList(self, editor, context): |
|
520 """ |
|
521 Public method to get a list of possible completions. |
|
522 |
|
523 @param editor reference to the editor object, that called this method |
|
524 (QScintilla.Editor) |
|
525 @param context flag indicating to autocomplete a context (boolean) |
|
526 @return list of possible completions (list of strings) |
|
527 """ |
|
528 completions = self.__caObject.getCompletions(editor) |
|
529 return completions |
518 |
530 |
519 def __editorAboutToBeSaved(self, filename): |
531 def __editorAboutToBeSaved(self, filename): |
520 """ |
532 """ |
521 Private slot to get the old contents of the named file. |
533 Private slot to get the old contents of the named file. |
522 |
534 |