1. 03 Dec, 2018 1 commit
  2. 23 Aug, 2018 1 commit
  3. 22 Jul, 2018 1 commit
  4. 18 Jul, 2018 1 commit
  5. 15 Mar, 2018 1 commit
  6. 01 Mar, 2018 1 commit
  7. 26 Feb, 2018 1 commit
  8. 09 Jan, 2018 6 commits
    • Milian Wolff's avatar
      Workaround: find declarations for constructor argument hints · 113deb25
      Milian Wolff authored
      Summary:
      For non-namespaced constructors we can find the declarations by
      manually adding the identifier a second time before the lookup,
      as that gives us the proper QID. This allows us to find the
      declaration for many situations, most notably for most Qt classes.
      
      Subscribers: kdevelop-devel
      
      Differential Revision: https://phabricator.kde.org/D9745
      113deb25
    • Milian Wolff's avatar
      Further extend the argument hint code completion test coverage · 67b8f6c2
      Milian Wolff authored
      Summary:
      Also check whether we find matching declarations, and add test
      code that uses namespaces. This uncovers a deficit in libclang,
      namely clang_getCompletionParent on the overload candidate completion
      strings does not return any valid string. Without a valid parent
      we cannot find the namespaced declarations and thus fail there...
      
      Subscribers: kdevelop-devel
      
      Differential Revision: https://phabricator.kde.org/D9744
      67b8f6c2
    • Milian Wolff's avatar
      Extend test coverage for argument hint code completion · 77d1f9d2
      Milian Wolff authored
      Summary: Also check the actual number of hints, and their contents.
      
      Subscribers: kdevelop-devel
      
      Differential Revision: https://phabricator.kde.org/D9743
      77d1f9d2
    • Milian Wolff's avatar
      clang: Improve argument hint code completion · 203b02d4
      Milian Wolff authored
      Summary:
      Previously, the overload candidates never got an DUChain Declaration
      associated, meaning we could not inspect the API documentation in-line
      from the code completion. The reason was that most of the time the
      hinted declaration is also a valid "normal" completion item, and thus
      was found a second time. The findDeclaration call then returned null
      for the second call, since we added the declaration to the exclusion
      set after the first call. Instead, use a separate set for overload
      candidates to fix this. Note that the expanded argument hint item
      is still not showing any documentation in-line... Apparently there's
      more to fix to get this done properly.
      
      While at it, also use the ArgumentHintItem for the situations where
      we (now) find a Declaration, to get proper current-argument
      highlighting.
      
      Then fix the unit test to expect the default arguments. Though
      potentially this is clang-version dependent? Anyhow, this makes the
      test pass for me on my machine with libclang from LLVM 5.0.0.
      
      Reviewers: #kdevelop
      
      Subscribers: kdevelop-devel
      
      Differential Revision: https://phabricator.kde.org/D9725
      203b02d4
    • Milian Wolff's avatar
      Fix: correct order of QCOMPARE(actual, expected) · 2ad24171
      Milian Wolff authored
      Summary: This improves the error message for this test if it fails.
      
      Reviewers: #kdevelop
      
      Subscribers: kdevelop-devel
      
      Differential Revision: https://phabricator.kde.org/D9724
      2ad24171
    • Milian Wolff's avatar
      Unbreak most of the clang codecompletion test by passing file contents · 28c6e5d5
      Milian Wolff authored
      Summary:
      Since the introduction of the CXUnsavedFile for the current document
      in the code completion (commit f14a8fc9 from July 2017 [!!!]) the
      unit tests where failing. The reason was that clang only saw empty
      file contents when the code completion context was created with
      no text. Previously, this used to fall-back to the actual file
      on-disk. Nowadays, this fallback does not exist anymore, thus we
      always have to pass the text in the unit tests. Do this and cleanup
      the code by sharing more code in functions.
      
      Reviewers: #kdevelop
      
      Subscribers: kdevelop-devel
      
      Differential Revision: https://phabricator.kde.org/D9723
      28c6e5d5
  9. 18 Nov, 2017 1 commit
    • Milian Wolff's avatar
      kdev-clang: Offer all include paths for code completion · 015141e3
      Milian Wolff authored
      We used to only offer code completion of project paths for local
      code completion in `#include "..."` contexts. And for vice versa,
      we only offered system paths for global code completion in
      `#include <...>` contexts. This is wrong, as the include style
      only changes the order in which a compiler iterates through these
      paths to find an include file. For code completion purposes, this
      is not important.
      
      Now we offer code completion in both path lists always. To show the
      user the right file/dir being included, we don't sort and unify the
      search path list anymore as that potentially changes the final result.
      Rather, we use a hash set to ensure we don't encounter paths multiple
      times and iterate over the search path lists in their original order.
      
      BUG: 386421
      015141e3
  10. 13 Sep, 2017 1 commit
  11. 28 Jun, 2017 2 commits
  12. 07 Apr, 2017 1 commit
  13. 23 Mar, 2017 1 commit
  14. 19 Mar, 2017 1 commit
  15. 20 Feb, 2017 1 commit
    • Milian Wolff's avatar
      Improve code completion of paths with dashes in their name · fcba3835
      Milian Wolff authored
      The model simply aborted code completion too soon, as it thought
      that the dash stops a word. But when we do include-path completion
      we actually want to not do that.
      
      This patch implements that by reusing our existing include path
      parser and then overwrites the corresponding model functions.
      
      Note that the code completion box still "hides" after writing the
      first "-", which I have not yet figured out why. Manual code
      completion works in this case now, though. In general, this patch
      improves quite a few things already so I'm pushing this early.
      
      CCBUG: 376461
      fcba3835
  16. 11 Dec, 2016 1 commit
  17. 17 Oct, 2016 1 commit
  18. 13 Jun, 2016 1 commit
  19. 03 May, 2016 2 commits
  20. 14 Mar, 2016 1 commit
  21. 17 Feb, 2016 1 commit
    • Maciej Cencora's avatar
      Clang: fix crash when editing variadic template "recursive" class · 6fcb1513
      Maciej Cencora authored
      The crash cannot be reproduced on completion, only when editing such class.
      To reproduce:
      1) create and save file with following content
      template <typename Head, typename ...Tail>
      struct my_class : Head, my_class<Tail...>
      {
          using base = Head;
      };
      2) in line with 'using' statement, mark the 'Head' text
      3) delete text
      4) write something (e.g. press letter 'a')
      
      Not sure whether this is proper fix, but backtrace shows infinite recursion.
      #0  clang::operator<< (OS=..., N=...) at /build/llvm-toolchain-3.6-18MJNr/llvm-toolchain-3.6-3.6.2/tools/clang/lib/AST/DeclarationName.cpp:136
      #1  0x00007fff7d266e9d in clang::NamedDecl::printName (this=<optimized out>, os=...) at /build/llvm-toolchain-3.6-18MJNr/llvm-toolchain-3.6-3.6.2/tools/clang/tools/libclang/../../include/clang/AST/Decl.h:150
      #2  getDeclSpelling (D=0x7fff9403bd00) at /build/llvm-toolchain-3.6-18MJNr/llvm-toolchain-3.6-3.6.2/tools/clang/tools/libclang/CIndex.cpp:3491
      #3  0x00007fff7d267686 in clang_getCursorSpelling (C=...) at /build/llvm-toolchain-3.6-18MJNr/llvm-toolchain-3.6-3.6.2/tools/clang/tools/libclang/CIndex.cpp:3625
      #4  0x00007fff7deb2e51 in (anonymous namespace)::baseClassVisitor (cursor=..., parent=..., data=0x7fff7c8f5090) at /home/mcencora/tmp/kdevelop/languages/clang/codecompletion/completionhelper.cpp:158
      #5  0x00007fff7d259add in clang::cxcursor::CursorVisitor::Visit (this=this@entry=0x7fff7c8f4f10, Cursor=..., CheckedRegionOfInterest=CheckedRegionOfInterest@entry=false)
          at /build/llvm-toolchain-3.6-18MJNr/llvm-toolchain-3.6-3.6.2/tools/clang/tools/libclang/CIndex.cpp:210
      #6  0x00007fff7d25bc34 in clang::cxcursor::CursorVisitor::VisitTemplateParameters (this=this@entry=0x7fff7c8f4f10, Params=<optimized out>) at /build/llvm-toolchain-3.6-18MJNr/llvm-toolchain-3.6-3.6.2/tools/clang/tools/libclang/CIndex.cpp:1321
      #7  0x00007fff7d259235 in clang::cxcursor::CursorVisitor::VisitClassTemplateDecl (this=0x7fff7c8f4f10, D=0x7fff9403bef0) at /build/llvm-toolchain-3.6-18MJNr/llvm-toolchain-3.6-3.6.2/tools/clang/tools/libclang/CIndex.cpp:903
      #8  0x00007fff7d2595db in clang::cxcursor::CursorVisitor::VisitChildren (this=this@entry=0x7fff7c8f4f10, Cursor=...) at /build/llvm-toolchain-3.6-18MJNr/llvm-toolchain-3.6-3.6.2/tools/clang/tools/libclang/CIndex.cpp:500
      #9  0x00007fff7d260024 in clang_visitChildren (parent=..., visitor=0x7fff7deb2ddf <(anonymous namespace)::baseClassVisitor(CXCursor, CXCursor, CXClientData)>, client_data=0x7fff7c8f5090)
          at /build/llvm-toolchain-3.6-18MJNr/llvm-toolchain-3.6-3.6.2/tools/clang/tools/libclang/CIndex.cpp:3419
      #10 0x00007fff7deb2dac in (anonymous namespace)::processBaseClass (cursor=..., parent=..., functionList=0x7fff74003590) at /home/mcencora/tmp/kdevelop/languages/clang/codecompletion/completionhelper.cpp:148
      #11 0x00007fff7deb2f42 in (anonymous namespace)::baseClassVisitor (cursor=..., parent=..., data=0x7fff7c8f5580) at /home/mcencora/tmp/kdevelop/languages/clang/codecompletion/completionhelper.cpp:166
      #12 0x00007fff7d259add in clang::cxcursor::CursorVisitor::Visit (this=this@entry=0x7fff7c8f5400, Cursor=..., CheckedRegionOfInterest=CheckedRegionOfInterest@entry=false)
          at /build/llvm-toolchain-3.6-18MJNr/llvm-toolchain-3.6-3.6.2/tools/clang/tools/libclang/CIndex.cpp:210
      #13 0x00007fff7d25919a in clang::cxcursor::CursorVisitor::VisitCXXRecordDecl (this=0x7fff7c8f5400, D=0x7fff9403be60) at /build/llvm-toolchain-3.6-18MJNr/llvm-toolchain-3.6-3.6.2/tools/clang/tools/libclang/CIndex.cpp:1672
      #14 0x00007fff7d2595db in clang::cxcursor::CursorVisitor::VisitChildren (this=this@entry=0x7fff7c8f5400, Cursor=...) at /build/llvm-toolchain-3.6-18MJNr/llvm-toolchain-3.6-3.6.2/tools/clang/tools/libclang/CIndex.cpp:500
      #15 0x00007fff7d260024 in clang_visitChildren (parent=..., visitor=0x7fff7deb2ddf <(anonymous namespace)::baseClassVisitor(CXCursor, CXCursor, CXClientData)>, client_data=0x7fff7c8f5580)
          at /build/llvm-toolchain-3.6-18MJNr/llvm-toolchain-3.6-3.6.2/tools/clang/tools/libclang/CIndex.cpp:3419
      #16 0x00007fff7deb2dac in (anonymous namespace)::processBaseClass (cursor=..., parent=..., functionList=0x7fff74003590) at /home/mcencora/tmp/kdevelop/languages/clang/codecompletion/completionhelper.cpp:148
      #17 0x00007fff7deb2f42 in (anonymous namespace)::baseClassVisitor (cursor=..., parent=..., data=0x7fff7c8f5a70) at /home/mcencora/tmp/kdevelop/languages/clang/codecompletion/completionhelper.cpp:166
      #18 0x00007fff7d259add in clang::cxcursor::CursorVisitor::Visit (this=this@entry=0x7fff7c8f58f0, Cursor=..., CheckedRegionOfInterest=CheckedRegionOfInterest@entry=false)
          at /build/llvm-toolchain-3.6-18MJNr/llvm-toolchain-3.6-3.6.2/tools/clang/tools/libclang/CIndex.cpp:210
      #19 0x00007fff7d25919a in clang::cxcursor::CursorVisitor::VisitCXXRecordDecl (this=0x7fff7c8f58f0, D=0x7fff9403be60) at /build/llvm-toolchain-3.6-18MJNr/llvm-toolchain-3.6-3.6.2/tools/clang/tools/libclang/CIndex.cpp:1672
      #20 0x00007fff7d2595db in clang::cxcursor::CursorVisitor::VisitChildren (this=this@entry=0x7fff7c8f58f0, Cursor=...) at /build/llvm-toolchain-3.6-18MJNr/llvm-toolchain-3.6-3.6.2/tools/clang/tools/libclang/CIndex.cpp:500
      #21 0x00007fff7d260024 in clang_visitChildren (parent=..., visitor=0x7fff7deb2ddf <(anonymous namespace)::baseClassVisitor(CXCursor, CXCursor, CXClientData)>, client_data=0x7fff7c8f5a70)
          at /build/llvm-toolchain-3.6-18MJNr/llvm-toolchain-3.6-3.6.2/tools/clang/tools/libclang/CIndex.cpp:3419
      #22 0x00007fff7deb2dac in (anonymous namespace)::processBaseClass (cursor=..., parent=..., functionList=0x7fff74003590) at /home/mcencora/tmp/kdevelop/languages/clang/codecompletion/completionhelper.cpp:148
      #23 0x00007fff7deb2f42 in (anonymous namespace)::baseClassVisitor (cursor=..., parent=..., data=0x7fff7c8f5f60) at /home/mcencora/tmp/kdevelop/languages/clang/codecompletion/completionhelper.cpp:166
      #24 0x00007fff7d259add in clang::cxcursor::CursorVisitor::Visit (this=this@entry=0x7fff7c8f5de0, Cursor=..., CheckedRegionOfInterest=CheckedRegionOfInterest@entry=false)
          at /build/llvm-toolchain-3.6-18MJNr/llvm-toolchain-3.6-3.6.2/tools/clang/tools/libclang/CIndex.cpp:210
      #25 0x00007fff7d25919a in clang::cxcursor::CursorVisitor::VisitCXXRecordDecl (this=0x7fff7c8f5de0, D=0x7fff9403be60) at /build/llvm-toolchain-3.6-18MJNr/llvm-toolchain-3.6-3.6.2/tools/clang/tools/libclang/CIndex.cpp:1672
      #26 0x00007fff7d2595db in clang::cxcursor::CursorVisitor::VisitChildren (this=this@entry=0x7fff7c8f5de0, Cursor=...) at /build/llvm-toolchain-3.6-18MJNr/llvm-toolchain-3.6-3.6.2/tools/clang/tools/libclang/CIndex.cpp:500
      #27 0x00007fff7d260024 in clang_visitChildren (parent=..., visitor=0x7fff7deb2ddf <(anonymous namespace)::baseClassVisitor(CXCursor, CXCursor, CXClientData)>, client_data=0x7fff7c8f5f60)
          at /build/llvm-toolchain-3.6-18MJNr/llvm-toolchain-3.6-3.6.2/tools/clang/tools/libclang/CIndex.cpp:3419
      
      ... and this goes on for 39K frames
      
      REVIEW: 126154
      6fcb1513
  22. 15 Feb, 2016 1 commit
  23. 14 Feb, 2016 2 commits
  24. 09 Feb, 2016 1 commit
  25. 08 Feb, 2016 1 commit
  26. 07 Feb, 2016 1 commit
    • Milian Wolff's avatar
      Also offer to implement function when in line of next function. · 83fb88ec
      Milian Wolff authored
      This fixes a bug where putting the cursor at the start of a line
      where another function is defined, no implementations are offered.
      
      This also workarounds the common case for bug 358521, where the
      real cause is that the TU is not properly updated. Thus the
      cursor will point to the old position where a function was and
      then no offers where given.
      
      CCBUG: 358521
      83fb88ec
  27. 09 Jan, 2016 1 commit
  28. 28 Nov, 2015 1 commit
    • Milian Wolff's avatar
      Fixup scope generation for nested classes in implementation helper. · 344738aa
      Milian Wolff authored
      This can be done by reusing a slightly adapted existing function
      and throwing away quite some other code which is brittle. In the end
      we now rely on clang_getCursorSemanticParent to build up the scope
      chain for us which will work even when one of the parents is not
      visited in the implementation helper.
      
      While at it, I also fixed the handling of functions in anonymous
      namespaces.
      
      BUG: 355954
      344738aa
  29. 12 Nov, 2015 1 commit
  30. 09 Nov, 2015 1 commit
  31. 11 Oct, 2015 1 commit
  32. 09 Oct, 2015 1 commit