AssistantEric/Assistant.py

changeset 35
6b706b02c2dd
parent 32
68ef15fe34c3
child 36
d4d279e10fa8
diff -r f35565337953 -r 6b706b02c2dd AssistantEric/Assistant.py
--- a/AssistantEric/Assistant.py	Sun Sep 25 17:22:03 2011 +0200
+++ b/AssistantEric/Assistant.py	Sun Sep 25 17:40:17 2011 +0200
@@ -327,7 +327,7 @@
                     api, word, context, prefix, mod, editor)
             
             if self.__plugin.getPreferences("AutoCompletionSource") & AcsDocument:
-                docCompletionsList = self.getCompletionsFromDocument(
+                docCompletionsList = self.__getDocumentCompletions(
                     editor, word, context, sep, prefix, mod)
             
             completionsList = list(
@@ -427,9 +427,9 @@
                         completionsList.append(entry)
         return completionsList
     
-    def getCompletionsFromDocument(self, editor, word, context, sep, prefix, module):
+    def __getDocumentCompletions(self, editor, word, context, sep, prefix, module):
         """
-        Public method to determine autocompletion proposals from the document.
+        Private method to determine autocompletion proposals from the document.
         
         @param editor reference to the editor object (QScintilla.Editor)
         @param word string to be completed (string)
@@ -464,10 +464,10 @@
                                 if (prefix == "cls" and \
                                     method.modifier == method.Class) or \
                                    prefix == "self":
-                                    comps.append((method.name, iconID))
+                                    comps.append((method.name, cl.name, iconID))
                             else:
                                 # eric 5.1 cannot differentiate method types
-                                comps.append((method.name, iconID))
+                                comps.append((method.name, cl.name, iconID))
                         if prefix != "cls":
                             for attribute in cl.attributes.values():
                                 # determine icon type
@@ -477,7 +477,7 @@
                                     iconID = Editor.AttributeProtectedID
                                 else:
                                     iconID = Editor.AttributePrivateID
-                                comps.append((attribute.name, iconID))
+                                comps.append((attribute.name, cl.name, iconID))
                         for attribute in cl.globals.values():
                             # determine icon type
                             if attribute.isPrivate():
@@ -486,15 +486,15 @@
                                 iconID = Editor.AttributeProtectedID
                             else:
                                 iconID = Editor.AttributePrivateID
-                            comps.append((attribute.name, iconID))
+                            comps.append((attribute.name, cl.name, iconID))
                         
                         if word != prefix:
                             completionsList.extend(
-                                ["{0}?{1}".format(c[0], c[1])
+                                ["{0} ({1})?{2}".format(c[0], c[1], c[2])
                                  for c in comps if c[0].startswith(word)])
                         else:
                             completionsList.extend(
-                                ["{0}?{1}".format(c[0], c[1])
+                                ["{0} ({1})?{2}".format(c[0], c[1], c[2])
                                  for c in comps])
                         break
             else:
@@ -517,7 +517,7 @@
                                 iconID = Editor.MethodProtectedID
                             else:
                                 iconID = Editor.MethodID
-                            comps.append((method.name, iconID))
+                            comps.append((method.name, cl.name, iconID))
                     for attribute in cl.globals.values():
                         # determine icon type
                         if attribute.isPrivate():
@@ -526,15 +526,15 @@
                             iconID = Editor.AttributeProtectedID
                         else:
                             iconID = Editor.AttributePrivateID
-                        comps.append((attribute.name, iconID))
+                        comps.append((attribute.name, cl.name, iconID))
                     
                     if word != prefix:
                         completionsList.extend(
-                            ["{0}?{1}".format(c[0], c[1])
+                            ["{0} ({1})?{2}".format(c[0], c[1], c[2])
                              for c in comps if c[0].startswith(word)])
                     else:
                         completionsList.extend(
-                            ["{0}?{1}".format(c[0], c[1])
+                            ["{0} ({1})?{2}".format(c[0], c[1], c[2])
                              for c in comps])
         
         if not prefixFound:
@@ -649,7 +649,7 @@
                 api, word, commas, prefix, mod, editor)
         
         if self.__plugin.getPreferences("AutoCompletionSource") & AcsDocument:
-            documentCalltips = self.__getCalltipsFromDocument(
+            documentCalltips = self.__getDocumentCalltips(
                 word, prefix, mod, editor)
         
         return sorted(
@@ -687,7 +687,7 @@
         
         return calltips
     
-    def __getCalltipsFromDocument(self, word, prefix, module, editor):
+    def __getDocumentCalltips(self, word, prefix, module, editor):
         """
         Private method to determine calltips from the document.
         

eric ide

mercurial