Skip to content
Snippets Groups Projects
  1. Mar 31, 2016
    • Nikolai Kosjar's avatar
      C++: Fix completion for doxygen tags II · da5309cb
      Nikolai Kosjar authored
      
      For assist processors that run in a worker thread, the QTextDocument is
      recreated with AssistInterface::prepareForAsyncUse and
      AssistInterface::recreateTextDocument.
      
      Since some assist processors (C++, QmlJS) rely on the user states of the
      QTextBlocks, these must be recreated, too.
      
      In the referenced bug report the lexer state (user state) of the
      previous QTextBlock was invalid and thus the "Doxygen tag completion"
      failed.
      
      Task-number: QTCREATORBUG-9373
      Change-Id: If668e98aa6f9fe9fc107c7476fc831e92a0d7572
      Reviewed-by: default avatarDavid Schulz <david.schulz@theqtcompany.com>
      da5309cb
    • Nikolai Kosjar's avatar
      C++: Fix completion for doxygen tags I · 4de62a73
      Nikolai Kosjar authored
      
      There are three cases that must be handled:
      
       1. Completion in C++ style comment
       2. Completion in first line of a C style comment
       3. Completion in non-first line of a C style comment
      
      This change fixes case 1 + 2. Case 3 will be addressed in a follow-up
      change, same goes for the duplication.
      
      Task-number: QTCREATORBUG-15143
      Change-Id: I449711f965ddcbbe6158870a8a5ae33218e0d238
      Reviewed-by: default avatarDavid Schulz <david.schulz@theqtcompany.com>
      4de62a73
  2. Jan 19, 2016
  3. Jan 13, 2016
  4. Nov 19, 2015
    • Nikolai Kosjar's avatar
      C++: Revert lookup to 3.4.2 · 0498fb68
      Nikolai Kosjar authored
      
      ...which was least buggy.
      
      The bugs fixed by the changes we revert here (highlighting/completion
      for code involving templates) were minor compared to ones we currently
      have. Those bugs will be addressed by the clang code model anyway.
      
      Relevant commits were collected via:
      
        $ cd ${QTC}/src/libs/cplusplus
        $ git log \
         --no-merges \
         --format=oneline \
         v3.4.2..HEAD \
         -- LookupContext.* ResolveExpression.* TypeResolver.* TypeOfExpression.* \
            ../../plugins/cpptools/cppcompletion_test.cpp
      
      From this list the following were skipped due to irrelevance:
      
        88c5b47e # CppTools: Minor cleanup in completion tests
        e5255a1f # CppTools: Add a test for ObjC not replacing dot with arrow
        5b12c8d6 # CppTools: Support ObjC in member access operator tests
        9fef4fb9 # CPlusPlus: Fix warnings about overriding visit(...) methods
      
      There were only minor conflicts while reverting those.
      
      This changes touches so many files because there were quite some
      cleanups and renames after the 3.4.2 release.
      
      Task-number: QTCREATORBUG-14889
      Task-number: QTCREATORBUG-15211
      Task-number: QTCREATORBUG-15213
      Task-number: QTCREATORBUG-15257
      Task-number: QTCREATORBUG-15264
      Task-number: QTCREATORBUG-15291
      Task-number: QTCREATORBUG-15329
      Change-Id: I01f759f8f35ecb4228928a4f22086e279c1a5435
      Reviewed-by: default avatarMarco Bubke <marco.bubke@theqtcompany.com>
      0498fb68
  5. Oct 20, 2015
  6. Sep 28, 2015
    • Nikolai Kosjar's avatar
      C++: Comment out a flaky test · e241444b
      Nikolai Kosjar authored
      
      The test relied on logic that was reverted with change
      915f68de.
      
      LookupScopePrivate::findSpecialization() gets a "TemplateNameIdTable
      &specializations" with a non-deterministic order. Without the extra
      logic, the very first entry will be chosen as the found specialization.
      
      The non-deterministic order comes from the TemplateNameId::Compare,
      which calls std::lexicographical_compare() with the template arguments,
      which are FullySpecifiedTypes. The result of
      FullySpecifiedType::operator<() might depend on a pointer comparison.
      
      Change-Id: I8d69d1bb5831145b1c21a5ea848c0043f17ec415
      Reviewed-by: default avatarChristian Stenger <christian.stenger@theqtcompany.com>
      e241444b
  7. Sep 23, 2015
  8. Sep 10, 2015
  9. Aug 31, 2015
  10. Aug 21, 2015
  11. Jul 01, 2015
    • Orgad Shaneh's avatar
      C++: Cleanup LookupContext · 7bed5cd3
      Orgad Shaneh authored
      
      Since the cache is now more reliable, some workarounds and optimizations
      in the instantiation process are not needed anymore.
      
      Also avoid instantiation of base classes when expandTemplates is
      disabled.
      
      As a bonus, we now resolve decltype of template function for a type that is not
      referenced anywhere but in the decltype.
      
      Change-Id: Idf42ba7280992db477c9aa62bb1815b27174594d
      Reviewed-by: default avatarNikolai Kosjar <nikolai.kosjar@theqtcompany.com>
      7bed5cd3
  12. Jun 29, 2015
  13. Jun 09, 2015
    • Orgad Shaneh's avatar
      C++: Support default template argument lookup for specialization · 97d3d9ac
      Orgad Shaneh authored
      
      This fixes std::vector, although it doesn't really resolve numeric
      template arguments. It just picks the first specialization.
      
      Use-case:
      class Foo {};
      template<class T1 = Foo> class Temp;
      template<> class Temp<Foo> { int var; };
      void func()
      {
          Temp<> t;
          t.var; // var not highlighted
      }
      
      Task-number: QTCREATORBUG-8922
      Change-Id: I593515beb3a6d901b6088db8bc1b8e16c39083d3
      Reviewed-by: default avatarNikolai Kosjar <nikolai.kosjar@theqtcompany.com>
      97d3d9ac
    • Orgad Shaneh's avatar
      C++: Improve accuracy in findSpecialization · 997ab425
      Orgad Shaneh authored
      
      * If a template type is specialized as a pointer, accept only pointers (of any
      type)
      * Same for references and arrays
      * Only if the specialized type is not part of the template, match it
        against the input.
      
      Fixes resolving of partial specialization with pointers.
      
      Use-cases:
      // 1
      struct b {};
      struct a : b {};
      template<class X, class Y> struct s { float f; };
      template<class X> struct s<X, b*> { int i; };
      template<class X> struct s<X, a*> { char j; };
      
      void f()
      {
          s<int, a*> var;
          var.j; // j not highlighted
      }
      
      // 2
      template <typename T> struct Temp { T variable; };
      template <typename T> struct Temp<T &> { T reference; };
      void func()
      {
          Temp<int&> templ;
          templ.reference; // reference not highlighted
      }
      
      // 3
      class false_type {};
      class true_type {};
      template<class T1, class T2> class and_type { false_type f; };
      template<> class and_type<true_type, true_type> { true_type t; };
      void func2()
      {
          and_type<true_type, false_type> a;
          a.f; // f not highlighted
      }
      
      Task-number: QTCREATORBUG-14036
      Change-Id: Idee5e3f41d15c0772318d3837cbcd442cb80293a
      Reviewed-by: default avatarNikolai Kosjar <nikolai.kosjar@theqtcompany.com>
      997ab425
  14. Jun 04, 2015
  15. Jun 02, 2015
    • Orgad Shaneh's avatar
      C++: Fix lookup for instantiation of using · b67ebf9f
      Orgad Shaneh authored
      
      Yet another std::vector issue...
      
      Use-cases:
      // Case 1
      template<typename T>
      using type = T;
      
      // Case 2
      struct Parent {
          template<typename T>
          using type = T;
      };
      
      // Case 3
      template<typename T>
      struct ParentT {
          template<typename DT>
          using type = DT;
      };
      
      struct Foo { int bar; };
      
      void func()
      {
          type<Foo> p1;
          Parent::type<Foo> p2;
          ParentT<Foo>::type<Foo> p3;
          // bar not highlighted
          p1.bar;
          p2.bar;
          p3.bar;
      }
      
      Task-number: QTCREATORBUG-14480
      Change-Id: I9ab08ea7360a432c48eb4b85aa0d63e08d2464c1
      Reviewed-by: default avatarNikolai Kosjar <nikolai.kosjar@theqtcompany.com>
      b67ebf9f
  16. Jun 01, 2015
  17. May 22, 2015
  18. May 20, 2015
  19. May 15, 2015
  20. Apr 28, 2015
    • Orgad Shaneh's avatar
      C++: Fix specialization resolution for nested types · ad4cb444
      Orgad Shaneh authored
      
      Use-cases:
      
      template<typename T>
      struct Traits { typedef typename T::pointer pointer; };
      
      template<typename _Tp>
      struct Traits<_Tp*> { typedef _Tp *pointer; };
      
      struct Foo { int bar; };
      
      // 1
      template<typename T>
      class Temp
      {
      protected:
         typedef Traits<T> TraitsT;
      
      public:
         typedef typename TraitsT::pointer pointer;
         pointer p;
      };
      
      void func()
      {
         Temp<Foo *> t;
         t.p-> // complete
      }
      
      // 2
      class Temp2
      {
      protected:
         typedef Foo *FooPtr;
         typedef Traits<FooPtr> TraitsT;
      
      public:
         typedef typename TraitsT::pointer pointer;
         pointer p;
      };
      
      void func2()
      {
         Temp2 t;
         t.p-> // complete
      }
      
      Task-number: QTCREATORBUG-14141
      Change-Id: Id3459671117c0c81bcde7c9714b42750634c0225
      Reviewed-by: default avatarNikolai Kosjar <nikolai.kosjar@theqtcompany.com>
      ad4cb444
  21. Apr 24, 2015
  22. Apr 23, 2015
  23. Apr 13, 2015
  24. Apr 11, 2015
  25. Apr 01, 2015
  26. Mar 25, 2015
  27. Mar 24, 2015
  28. Mar 13, 2015
  29. Mar 05, 2015
  30. Feb 27, 2015
Loading