Skip to content
Snippets Groups Projects
  1. Mar 31, 2016
    • 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. Oct 06, 2015
  4. Jun 03, 2015
  5. Apr 24, 2015
    • Nikolai Kosjar's avatar
      CppTools: Remove separate indexing revision · d4bb5033
      Nikolai Kosjar authored
      
      For indexing we used a custom revision that was updated on each
      modelManager BuiltinIndexingSupport::refreshSourceFiles() call. This
      could lead to rejection of updated documents triggered by refactoring
      actions, like for the following case:
      
       1. Open a project containing a.h and a.cpp
       2. Open a.cpp, insert some new lines, save and close the document
       3. Open a.h and rename a function that is defined in a.cpp
          --> The refactoring action modifies a.h and a.cpp, so re-indexing
              of those is triggered. Since a.cpp has already a higher revision
              (step 2) than the updated document, the updated document is
              discarded. As a consequence find usages and follow symbol fails
              for the renamed function.
      
      Now the document call back provided to CppSourceProcessor is responsible
      for updating the document revision based on the latest revision in the
      global snapshot.
      
      Change-Id: I4dfa0a4d34991655acfa749109f00c47b0fbfdbe
      Reviewed-by: default avatarOrgad Shaneh <orgads@gmail.com>
      Reviewed-by: default avatarErik Verbruggen <erik.verbruggen@theqtcompany.com>
      Reviewed-by: default avatarEike Ziller <eike.ziller@theqtcompany.com>
      d4bb5033
  6. Apr 13, 2015
  7. Jan 16, 2015
  8. Dec 15, 2014
  9. Dec 03, 2014
    • Nikolai Kosjar's avatar
      CppTools: Update document on activation · cb0d1369
      Nikolai Kosjar authored
      
      ...if the project was updated in the meanwhile.
      
      If a project is updated mark invisible editor documents dirty and update
      them if they get focus.
      
      This also fixes document highlighting when restoring a session for
      documents that the user "switched away" before the project info is
      pushed to CppModelManager.
      
      This completes
      
          CppTools: Update visible documents on project update
          commit c2eb91e0
      
      which only takes care of visible documents.
      
      Task-number: QTCREATORBUG-13270
      Change-Id: Id445e7f509deac5d03194aecc54ce4629b7926ce
      Reviewed-by: default avatarErik Verbruggen <erik.verbruggen@theqtcompany.com>
      cb0d1369
  10. Oct 09, 2014
  11. Oct 02, 2014
  12. Sep 19, 2014
  13. Jul 24, 2014
    • Nikolai Kosjar's avatar
      CppTools: Auto-include pre-compiled headers · 6a9ae7e2
      Nikolai Kosjar authored
      
      So far the pre-compiled headers were processed (thus defines from those
      headers were visible), but the actual includes for the documents were
      not added, which is necessary for lookup/completion.
      
      Note that this will be only done if pre-compiled headers are not ignored
      (Options > C++ > Code Model > [] Ignore pre-compiled headers).
      
      Change-Id: I54a8e6b00597af164d958e3e9f2a1075ea187788
      Reviewed-by: default avatarErik Verbruggen <erik.verbruggen@digia.com>
      6a9ae7e2
  14. Jul 15, 2014
  15. Jul 04, 2014
  16. Jun 10, 2014
    • Nikolai Kosjar's avatar
      CppTools: Unexport some internal classes. · 11845cd3
      Nikolai Kosjar authored
      
      Unexports CppModelManager, CppSourceProcessor and CppToolsPlugin.
      
      Now only some constructor signatures mention "Internal::" in the
      exported symbols:
      
      % nm --extern-only --demangle ./lib/qtcreator/plugins/libCppTools.so | grep "Internal::"
      CppTools::CppClassesFilter::CppClassesFilter(CppTools::Internal::CppLocatorData*)
      CppTools::CppClassesFilter::CppClassesFilter(CppTools::Internal::CppLocatorData*)
      CppTools::CppEditorSupport::CppEditorSupport(CppTools::Internal::CppModelManager*, TextEditor::BaseTextEditor*)
      CppTools::CppEditorSupport::CppEditorSupport(CppTools::Internal::CppModelManager*, TextEditor::BaseTextEditor*)
      
      Change-Id: I167c21a6dc03cf02230c95fde66cf404e40df36f
      Reviewed-by: default avatarErik Verbruggen <erik.verbruggen@digia.com>
      11845cd3
    • Nikolai Kosjar's avatar
      Cpp{Editor,Tools}: Move tests for IncludeGroups to CppTools · 9921960a
      Nikolai Kosjar authored
      
      They belong there. This will also kill the CppSourceProcessor dependency
      from CppEditor.
      
      Change-Id: Ic2ae6b0c6f0913d913636be61df194846985d1ce
      Reviewed-by: default avatarErik Verbruggen <erik.verbruggen@digia.com>
      9921960a
  17. Jun 04, 2014
  18. Jun 03, 2014
  19. May 28, 2014
  20. Mar 10, 2014
  21. Feb 24, 2014
  22. Feb 20, 2014
  23. Jan 21, 2014
  24. Jan 08, 2014
  25. Dec 23, 2013
    • Orgad Shaneh's avatar
      CppTools: Make completion tests data-driven · 0909c029
      Orgad Shaneh authored
      
      Mostly done using the following Ruby script:
      
      Fname = 'src/plugins/cpptools/cppcompletion_test.cpp'
      s = File.read(Fname)
      mod = s.gsub(/(?<declaration>void CppToolsPlugin::test_(?<test_name>[^(]+)\(\)\n\{)(?<body>.*?\n)\}/m) { |func|
        match = $~
        declaration = match['declaration']
        body = match['body']
        test_name = match['test_name'].sub('_data', '')
        final = body.gsub(/(?:completions.clear\(\);\s+)?(?: +)[^\n]* =\n(?<code>.*?);\s*(?<completions>(?:completions.append\(QLatin1String\("[^"]*"\)\);\s*)*)QTest::newRow\("case: (?<name>.+?)"\)\s*<< code << _\("(?<prefix>[^"]+)"\) << completions;/m) {
          m = $~
          res = "    QTest::newRow(\"#{test_name}: #{m['name']}\") << _(\n#{m['code'].rstrip}\n        ) << _(\"#{m['prefix']}\") << (QStringList()"
          m['completions'].scan(/completions.append\((.+)\);/) { |comp|
            res << "\n            << #{comp[0]}"
          }
          res + ');'
        }.gsub(/(?: +)[^\n]* =\n(?<code>.*?);\n\s*CompletionTestCase test\(.+?, "(?<prefix>.+?)"\);\s*QStringList expected;\s*(?<completions>(?:expected.append\(QLatin1String\("[^"]*"\)\);\s*)*)const QStringList completions = test.getCompletions\(\);\s*QCOMPARE\(completions, expected\);/m) {
          m = $~
          res = "    QTest::newRow(\"#{test_name}\") << _(\n#{m['code'].rstrip}\n        ) << _(\"#{m['prefix']}\") << (QStringList()"
          m['completions'].scan(/expected.append\((.+)\);/) { |comp|
            res << "\n            << #{comp[0]}"
          }
          res + ');'
        }.gsub(/(?: +)[^\n]* =\n(?<code>.*?);\n\s*CompletionTestCase test\(.+?(?:, (?<prefix>".+?"))?\);\s*(?:const )?QStringList completions = test.getCompletions\(\);\s*QCOMPARE\(completions.size\(\), \d+\);(?<completions>(?:\s*QVERIFY\(completions.contains\([^\n]+\);)*)\n/m) { |mm|
          m = $~
          res = "    QTest::newRow(\"#{test_name}\") << _(\n#{m['code'].rstrip}\n        ) << _(#{m['prefix']}) << (QStringList()"
          m['completions'].scan(/QVERIFY\(completions.contains\((.+?)\)\);/) { |comp|
            res << "\n            << #{comp[0]}"
          }
          res + ");\n"
        }.gsub(/(?: +)[^\n]* =\n(?<code>.*?);\n\s*CompletionTestCase test\(.+?(?:, (?<prefix>".+?"))?\);\s*bool replaceAccessOperator = false;\s*const QStringList completions = test.getCompletions\(\&replaceAccessOperator\);\s*QCOMPARE\(completions.size\(\), \d+\);(?<completions>(?:\s*QVERIFY\(completions.contains\([^\n]+\);)*)\s*QVERIFY\((?<replace>!?)[^)]*\);\n/m) { |mm|
          m = $~
          res = "    QTest::newRow(\"#{test_name}\") << _(\n#{m['code'].rstrip}\n        ) << _(#{m['prefix']}) << (QStringList()"
          m['completions'].scan(/QVERIFY\(completions.contains\((.+?)\)\);/) { |comp|
            res << "\n            << #{comp[0]}"
          }
          res + ")\n        << #{m['replace'].empty?};\n"
        }
        if final == body or final['QTest::addColumn']
          declaration + final + "}"
        else
          final
        end
      }.gsub(/QTest::newRow\("([^"]+)"/) { |m|
        name = $1
        if name.size > 73
          space = name[0..73].rindex(/[ _]/)
          "QTest::newRow(\"#{name[0..space]}\"\n                  \"#{name[space+1..-1]}\""
        else
          m
        end
      }.gsub(/\s+QTest::newRow/, "\n\n    QTest::newRow")
      if mod != s
          File.open(Fname, 'wt').write(mod)
      end
      
      Change-Id: Id6bfb03cdf31ac27b36028fcdc861c340a5398f4
      Reviewed-by: default avatarNikolai Kosjar <nikolai.kosjar@digia.com>
      0909c029
  26. Dec 11, 2013
  27. Nov 22, 2013
  28. Nov 12, 2013
  29. Oct 18, 2013
  30. Oct 17, 2013
    • Przemyslaw Gorszkowski's avatar
      C++: fix endless loop during template instantiation · 5be56c07
      Przemyslaw Gorszkowski authored
      
      This is the first phase of fixing bug QTCREATORBUG-10320.
      This change resolves typedefs of template parameters(and resolves
      problem with endless loop).
      
      The next step will be matching appropriate template specialization
      (this is needed to solve problem with missing code completion).
      
      Missing matching: template specialization with the same parameters,
      e.g.:
      template <class T1, class T2, class T3>
      class T
      {
      };
      
      template <class T1, class T2>
      class T<T1, T2, T2>
      {
      };
      
      Task-number: QTCREATORBUG-10320
      Change-Id: Icb6b539c021b2a67a66db9011a2e627f7d96526b
      Reviewed-by: default avatarPrzemyslaw Gorszkowski <pgorszkowski@gmail.com>
      Reviewed-by: default avatarNikolai Kosjar <nikolai.kosjar@digia.com>
      5be56c07
  31. Oct 01, 2013
  32. Sep 13, 2013
  33. Sep 03, 2013
  34. Aug 22, 2013
Loading