[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [kdev-python] codecompletion: remove a few items from autocompletion which shouldn't be there
From:       Sven Brauch <svenbrauch () googlemail ! com>
Date:       2012-02-29 21:38:05
Message-ID: 20120229213805.F1F9EA60A9 () git ! kde ! org
[Download RAW message or body]

Git commit 9eb5e43e193ce64bf94d5baff9be00da9c0f93c5 by Sven Brauch.
Committed on 29/02/2012 at 22:37.
Pushed by brauch into branch 'master'.

remove a few items from autocompletion which shouldn't be there

M  +8    -1    codecompletion/pythoncodecompletioncontext.cpp

http://commits.kde.org/kdev-python/9eb5e43e193ce64bf94d5baff9be00da9c0f93c5

diff --git a/codecompletion/pythoncodecompletioncontext.cpp \
b/codecompletion/pythoncodecompletioncontext.cpp index 746a044..5d54524 100644
--- a/codecompletion/pythoncodecompletioncontext.cpp
+++ b/codecompletion/pythoncodecompletioncontext.cpp
@@ -269,7 +269,11 @@ QList<CompletionTreeItemPointer> \
                PythonCodeCompletionContext::completionItems(bo
         QList<DeclarationDepthPair> declarations = \
m_duContext->allDeclarations(m_position, m_duContext->topContext());  \
QList<DeclarationDepthPair> remainingDeclarations;  foreach ( DeclarationDepthPair d, \
                declarations ) {
-            if ( d.first && dynamic_cast<ClassDeclaration*>(d.first) ) {
+            Declaration* r = Helper::resolveAliasDeclaration(d.first);
+            if ( r and \
r->identifier().identifier().str().contains("__kdevpythondocumentation_builtin") ) { \
+                continue; +            }
+            if ( r && dynamic_cast<ClassDeclaration*>(r) ) {
                 remainingDeclarations << d;
             }
         }
@@ -354,6 +358,9 @@ QList<CompletionTreeItemPointer> \
                PythonCodeCompletionContext::completionItems(bo
             if ( d.first and d.first->context()->type() == DUContext::Class ) {
                 declarations.removeAll(d);
             }
+            if ( d.first and \
d.first->identifier().identifier().str().contains("__kdevpythondocumentation_builtin") \
) { +                declarations.removeAll(d);
+            }
         }
         items.append(declarationListToItemList(declarations));
     }


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic