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

List:       kde-commits
Subject:    [kdev-php] duchain: fix use building for strings
From:       Niko Sams <niko.sams () gmail ! com>
Date:       2014-03-08 8:41:36
Message-ID: E1WMCp6-0001dF-Kb () scm ! kde ! org
[Download RAW message or body]

Git commit 642890b2146c118fd8ae2017e981402ccecf38bd by Niko Sams.
Committed on 08/03/2014 at 08:15.
Pushed by nsams into branch 'master'.

fix use building for strings

class names aren't case sensitive so we need to lowercase before searching

M  +1    -1    duchain/expressionvisitor.cpp
M  +1    -1    duchain/tests/uses.cpp

http://commits.kde.org/kdev-php/642890b2146c118fd8ae2017e981402ccecf38bd

diff --git a/duchain/expressionvisitor.cpp b/duchain/expressionvisitor.cpp
index 0033225..7deb116 100644
--- a/duchain/expressionvisitor.cpp
+++ b/duchain/expressionvisitor.cpp
@@ -462,7 +462,7 @@ void ExpressionVisitor::visitScalar(ScalarAst *node)
         QRegExp exp("^['\"]([A-Za-z0-9_]+)['\"]$");
         if (exp.exactMatch(str)) {
             //that *could* be a class name
-            QualifiedIdentifier id(exp.cap(1));
+            QualifiedIdentifier id(exp.cap(1).toLower());
             DeclarationPointer declaration = findDeclarationImport(ClassDeclarationType, id);
             if (declaration) {
                 usingDeclaration(node->commonScalar, declaration);
diff --git a/duchain/tests/uses.cpp b/duchain/tests/uses.cpp
index 319bc58..b9ea20b 100644
--- a/duchain/tests/uses.cpp
+++ b/duchain/tests/uses.cpp
@@ -1094,7 +1094,7 @@ void TestUses::classNameString()
     //                 0         1         2         3         4         5         6         7
     //                 01234567890123456789012345678901234567890123456789012345678901234567890123456789
     QByteArray method("<? class Foo { } echo 'Foo';");
-    TopDUContext* top = parse(method, DumpAll);
+    TopDUContext* top = parse(method, DumpNone);
     DUChainReleaser releaseTop(top);
     DUChainWriteLocker lock(DUChain::lock());
 
[prev in list] [next in list] [prev in thread] [next in thread] 

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