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

List:       kde-commits
Subject:    [kdev-qmljs] codecompletion: Give type "enum" to enumerations in code completion
From:       Denis Steckelmacher <steckdenis () yahoo ! fr>
Date:       2014-05-31 17:15:14
Message-ID: E1WqmsE-0007ra-4K () scm ! kde ! org
[Download RAW message or body]

Git commit 8fb7b88c8d7a0294712db0a57b9c8a060c4f1a54 by Denis Steckelmacher.
Committed on 31/05/2014 at 14:16.
Pushed by dsteckelmacher into branch 'master'.

Give type "enum" to enumerations in code completion

M  +7    -0    codecompletion/completionitem.cpp

http://commits.kde.org/kdev-qmljs/8fb7b88c8d7a0294712db0a57b9c8a060c4f1a54

diff --git a/codecompletion/completionitem.cpp b/codecompletion/completionitem.cpp
index d90569c..6d41a2b 100644
--- a/codecompletion/completionitem.cpp
+++ b/codecompletion/completionitem.cpp
@@ -55,6 +55,13 @@ QVariant CompletionItem::data(const QModelIndex& index, int role, const CodeComp
             }
         }
 
+        if (decl && decl->abstractType() &&
+            decl->kind() == Declaration::Type &&
+            decl->abstractType()->whichType() == AbstractType::TypeEnumeration) {
+            // Enum
+            return QString("enum");
+        }
+
         if (declType &&
             decl->kind() == Declaration::Instance &&
             declType->declarationId().qualifiedIdentifier().isEmpty()) {
[prev in list] [next in list] [prev in thread] [next in thread] 

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