Commit Graph

133 Commits

Author SHA1 Message Date
Nikolai Kosjar
ff1203de9e C++: Fix Macrouse::utf16charsBegin()
This caused displaced highlighting of macro uses after #if constructs.

MacroUse::utf16charBegin() was based on the last "continuation token",
which was wrong.

Change-Id: I89983d82fcf804ba853c04a59a7533c489785d05
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2014-06-03 14:54:17 +02:00
Erik Verbruggen
a870c29a71 C++: use a global string table for SearchSymbols.
This string table uniques strings, so that multiple identical strings
share their contents. It is used by the locator and the symbol searcher,
and will later be used by the class view.

Change-Id: Ib8b50f69bbf994d0d7a39b66dc8caf1a3d9bfb42
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2014-05-28 15:54:38 +02:00
Nikolai Kosjar
aa796a9fc0 CppTools: Add all diagnostic messages
...of type 'No such file or directory' to the CPlusPlus::Document. Only
the first one was added and as a result, the editor only wavely
underlined that one.

Add also diagnostic messages if it's not possible to get the file
contents.

Change-Id: I8389d8e6af9480ea6712759ce5e130e1dd8912f1
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2014-03-10 13:42:43 +01:00
Nikolai Kosjar
c2803b00be CppTools: Avoid self-include
...in CPlusPlus::Document due to cyclic includes.

Task-number: QTCREATORBUG-11457
Change-Id: I1ca19c901c26d9984d795a61879dd6b41c57096c
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2014-02-24 14:08:11 +01:00
Nikolai Kosjar
f785402972 CppTools: Cleanup test_cpppreprocessor_includes
Use QCOMPARE instead of QVERIFY where appropriate.

Change-Id: I7965a00fd004b8c3a20186bb692bf541f154d12b
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2014-02-20 13:47:43 +01:00
Orgad Shaneh
1fd576c1f6 C++: Add support for prefixes in switch header/source
Task-number: QTCREATORBUG-11031

Change-Id: I93cce0ebf46984eb06094e1f1519717be2bbaa79
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2014-01-21 12:20:15 +01:00
Orgad Shaneh
f506104f29 CppTools: Cleanup header/source test
Dynamically create data files in tempPath and clean them up when
finished.

Change-Id: Ie78f557b185b264acc0d0f5814646c203d8a93f4
Reviewed-by: Petar Perisin <petar.perisin@gmail.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2014-01-21 11:07:49 +01:00
Eike Ziller
236ea9efb9 Merge remote-tracking branch 'origin/3.0'
Conflicts:
	share/qtcreator/debugger/dumper.cpp
	share/qtcreator/debugger/dumper_p.h
	share/qtcreator/debugger/test/main.cpp
	src/plugins/debugger/gdb/classicgdbengine.cpp
	src/plugins/debugger/gdb/pythongdbengine.cpp
	src/plugins/debugger/lldblib/guest/lldbengineguest.cpp
	src/plugins/debugger/lldblib/guest/lldbengineguest.h
	src/plugins/debugger/lldblib/guest/main.cpp
	src/plugins/debugger/lldblib/ipcengineguest.cpp
	src/plugins/debugger/lldblib/ipcengineguest.h
	src/plugins/debugger/lldblib/ipcenginehost.cpp
	src/plugins/debugger/lldblib/ipcenginehost.h
	src/plugins/debugger/lldblib/lldbenginehost.cpp
	src/plugins/debugger/lldblib/lldboptionspage.cpp
	src/plugins/qbsprojectmanager/qbsstep.cpp
	src/plugins/qbsprojectmanager/qbsstep.h
	src/plugins/qmlprofiler/canvas/qdeclarativecanvas.cpp
	src/plugins/qmlprofiler/canvas/qdeclarativecanvas_p.h
	src/plugins/qmlprofiler/canvas/qdeclarativecontext2d.cpp
	src/plugins/qmlprofiler/canvas/qdeclarativecontext2d_p.h
	src/plugins/qmlprofiler/canvas/qmlprofilercanvas.cpp
	src/plugins/qnx/blackberrycheckdevmodestep.cpp
	src/plugins/qtsupport/debugginghelper.cpp

Change-Id: Ie9fd0a885fb6264a6a8a72daee071b75bcbd2e9d
2014-01-08 11:01:06 +01:00
Robert Loehning
746c5d8863 Incremented year in copyright info
Change-Id: Ib5423fdd064e4546f848c0b640b0ed0514c26d3a
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com>
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2014-01-08 08:29:47 +01:00
Orgad Shaneh
0909c0295f CppTools: Make completion tests data-driven
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: Nikolai Kosjar <nikolai.kosjar@digia.com>
2013-12-23 13:46:49 +01:00
Nikolai Kosjar
273192759b CppEditor/CppTools: Move FunctionHelper to CppTools
...and rename it to FunctionUtils.

Change-Id: If076ec01fd82e8ba728764bdeab7e87e8bc1ff3b
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2013-12-11 11:46:33 +01:00
Przemyslaw Gorszkowski
4836fa0106 C++: fix auto completion for member of classes accessed by using
Example:
namespace NS { struct S { int member; void fun(); }; }
using NS::S;
void S::fun()
{
mem// ctrl+space
}

Task-number: QTCREATORBUG-9037
Change-Id: I5a568be1b5c44deb02caa04996167a88a9c5d4d7
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2013-11-22 16:12:53 +01:00
Nikolai Kosjar
7eeb87295b CppTools: Add basic test for TypeHierarchyBuilder
Change-Id: I7a82f2b22105d4e096fc0bd69679adacdde2c731
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2013-11-12 16:40:41 +01:00
Nikolai Kosjar
e58906a9ed C++: Limit typedef resolving depth
This reverts commit 5be56c0 except for its tests. While it fixed the
problem described in the bug report, it also introduced regressions.

For now, we use a hard limit.

Change-Id: I19a85be454e3d7969371707e3eb1c3d42a16ecee
Reviewed-by: Przemyslaw Gorszkowski <pgorszkowski@gmail.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2013-10-18 14:07:00 +02:00
Przemyslaw Gorszkowski
5be56c073e C++: fix endless loop during template instantiation
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: Przemyslaw Gorszkowski <pgorszkowski@gmail.com>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2013-10-17 11:43:27 +02:00
Erik Verbruggen
8c79d5bc23 C++: add code-model support for defines-per-editor.
The UI side will come in another commit.

Change-Id: I1038a438587fe4cef70408f7f627d08837fc192d
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2013-10-01 13:03:47 +02:00
Erik Verbruggen
507452f097 CppTools: honor pre-compiled headers in the code-model.
Task-number: QTCREATORBUG-476

Change-Id: I82ed92acdcda551d2c6a9ca221832ac20117a08f
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2013-10-01 13:02:45 +02:00
Erik Verbruggen
ba2d7a4fa7 C++: Only parse with appropriate defines for open editors.
If two files from different (sub-)projects include the same header file,
and the defined macros differ for both files, the header file will be
parsed with only the appropriate macros for the including file.

Task-number: QTCREATORBUG-9802
Task-number: QTCREATORBUG-1249

Change-Id: I560490afa287b3bb1e863bce1bb4f57af36ad56e
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2013-10-01 10:33:51 +02:00
Erik Verbruggen
c9f5a14bdd C++: add code-model settings to choose one by mime-type.
The model-manager now supports multiple code models for semantic
highlighting and code completion, and will choose one based on the
mime-type of the editor.

The settings page is currently disabled. It will get enabled when a
second plug-in lands that has a ModelManagerSupport class.

Change-Id: I10023f52322ed6860397da15dba1c231e80e6517
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2013-09-13 14:37:48 +02:00
Alexey Semenko
da4c4b80f3 Completions: move continuations upper in proposals list.
Since fuzzy completions are allowed, the lexicographically first proposal
is not necessarily most relevant. The patch modifies sorting of proposals
so that the exact match and continuations go first, and fuzzy completions
follow.

Moreover, being a continuation seem to be a more important characteristic
of a proposal, than being it a function argument or keyword etc. That's why
the check for continuation is placed before the check for order.

Task-number: QTCREATORBUG-8737
Task-number: QTCREATORBUG-9236
Change-Id: I89aae9d2ce6bfa59af7c2f75e6f3af00212008ca
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Alexey Zhondin <lexxmark.dev@gmail.com>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2013-09-03 14:44:41 +02:00
Orgad Shaneh
adee8336bb C++: Custom directory list for Switch Header/Source
Some projects use separate directories for sources and headers.

An example tree:
*
|-- src
     |-- foo.cpp
|-- include
     |-- foo.h

Allow the user to specify directories for finding out-of-project related
header/source files, in addition to current directory

Task-number: QTCREATORBUG-8883
Change-Id: I57215c8f2feffcc246d0d161798290861bcfcdd4
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2013-09-03 14:25:05 +02:00
Nikolai Kosjar
fd9293dd0a CppTools: CppPreprocessor: Track also unresolved includes
Change-Id: Ia36e7e7142dbc030a428369ed04e76e70e8eef0b
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2013-08-22 11:57:27 +02:00
Oswald Buddenhagen
c2e90c360b Merge remote-tracking branch 'origin/2.8'
Conflicts:
	src/plugins/cpptools/cppcompletion_test.cpp
	src/plugins/cpptools/cpptoolsplugin.h
	src/plugins/projectexplorer/customtoolchain.cpp
	src/plugins/vcsbase/command.cpp

Change-Id: Ie7b3c9e136c0748b41320227c757471259339b48
2013-08-21 14:39:18 +02:00
Nikolai Kosjar
d185849150 CppTools: Tests: Introduce basic BuiltinSymbolSearcher tests
Change-Id: I25f11e80747863f797d146980d8ee0e605acb6e5
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2013-08-20 14:18:45 +02:00
Nikolai Kosjar
dcf618469d CppTools: Tests: Add basic tests for locator filters
Change-Id: Ie71aa8a39f4584a024a4f104841ad8e57947e489
Reviewed-by: David Schulz <david.schulz@digia.com>
2013-08-19 14:43:58 +02:00
Nikolai Kosjar
8ea14767af CppTools: Rework handling of ProjectInfo changes
(a) The code model manager figures out by itself which files were added
    or removed from the project.

    If this was done successfully, check also the timestamp of the
    common files and reindex if necessary.

(b) A full reindexing is only triggered if the project configuration
    changes (defines, includes, framework paths).

(c) If project files were removed, the garbage collector is called.

Task-number: QTCREATORBUG-9730
Change-Id: Ib855614b070880576233a3525813617c967a72f3
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
2013-08-13 14:13:33 +02:00
Nikolai Kosjar
2665a1249b CppTools: Do not garbage collect files in the working copy
...except the configuration file if no projects are open. For this case
there is no need to keep the configuration file around.

Task-number: QTCREATORBUG-9829

Change-Id: I51b01b30c17cbc1ced491ef2c47c338dae6ed983
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2013-08-08 12:12:31 +02:00
Przemyslaw Gorszkowski
bfbf93e64f C++: fix auto completion for template parameters
Fix auto completion for the case when template parameter should be
found somewhere of scope of template instantiation declaration.
Example:
struct A
{
    void foo();
    struct B
    {
        int b;
    };
};

template<typename T>
struct Template
{
    T* get() { return 0; }
    T t;
};

void A::foo()
{
    Template<B> templ;
    templ.get()->//no autocompletion
    templ.t.//no autocompletion
}

Task-number: QTCREATORBUG-8852
Task-number: QTCREATORBUG-9169
Change-Id: I56b40776e66740f995ae6fc5d69e3c50139a3af2
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2013-08-05 10:50:38 +02:00
Nikolai Kosjar
8d283ffd16 CppTools: Hide "QPrivateSignal" on signal completion (Qt5)
See also http://woboq.com/blog/how-qt-signals-slots-work-part2-qt5.html

Task-number: QTCREATORBUG-8540
Change-Id: Iccad837d7a0da982e7d7a1eda95ff1828cf1dce6
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
2013-07-31 10:21:14 +02:00
Oswald Buddenhagen
6896546ba5 Merge remote-tracking branch 'origin/2.8'
Conflicts:
	src/plugins/cpptools/cppmodelmanager.cpp

Change-Id: I0e69dfad951eb81d8008f5ca05e8fb6999ae2c8a
2013-07-25 13:18:31 +02:00
Nikolai Kosjar
072b7c5718 CppTools: Check if project has changed before reparsing
This introduces an API change for the project managers. Those are not
expected to call updateSourceFiles() anymore.

Task-number: QTCREATORBUG-9581
Change-Id: I77befd29fb851c9acf87204d571da00183c9cd05
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2013-07-22 08:33:52 +02:00
Nikolai Kosjar
d0e5facb0e CppTools: Tests: Clean up cppmodelmanager_test.cpp
* First construct a ProjectPart completely, then append it to the
  ProjectInfo. Doing it the other way around will lead to
  inconsistencies since some attributes of ProjectInfo are
  calculated/updated when a ProjectPart is appended. This has no effect
  on the current tests.

* Remove created *.user file when test finishes.

* Add comments describing what the tests do.

* Rename test methods to some more desribtive names.

Change-Id: I5eeed05d0aef19f8094ff488dedcced74f0814f8
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2013-07-22 08:32:51 +02:00
Nikolai Kosjar
c84e3a27d6 CppTools: Garbage collect if the last CppEditor is closed
Task-number: QTCREATORBUG-9828

Change-Id: Ie0ef9757cedb772702e49542b58d5b589506aa9e
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2013-07-17 14:54:10 +02:00
Przemyslaw Gorszkowski
3cde52846e C++: fix local types and members
It fixes code model when we have local type which contains a member
of other type, e.g.:
struct OtherType { int otherTypeMember; };
void foo()
{
    struct LocalType
    {
        int localTypeMember;
        OtherType ot;
    };

    LocalType lt;
    lt.ot.//no code completion
}

Change-Id: I018f492a6c48bfcbba0ef376ef005825e2b13f35
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2013-07-12 16:12:59 +02:00
Przemyslaw Gorszkowski
46461fc183 C++: code completion for lambda calls
support for lambdas, e.g.:
struct S { int bar; };
[]() { return new S; } ()->bar;
[] { return new S; } ()->bar;
[]() ->S* { return new S(); } ()->bar;
[]() throw() { return new S(); } ()->bar;
[]() throw()->S* { return new S(); } ()->bar;

Task-number: QTCREATORBUG-9523
Change-Id: I43fbf6f0ee0bb11411c53c984df75ef33a276466
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2013-07-12 12:47:09 +02:00
Eike Ziller
8685ff8a28 Merge remote-tracking branch 'origin/2.8' into HEAD
Conflicts:
	qtcreator.pri
	qtcreator.qbs

Change-Id: I5d2018d3437b99bcdffa92bf1a212f42923c4fad
2013-07-03 16:55:27 +02:00
Nikolai Kosjar
c264c0d213 C++: Fix resolving ui_* files in CppPreprocessor
The working copy contains the artificial ui_* files and therefore we
have to consider it while resolving include files.

Task-number: QTCREATORBUG-9683
Change-Id: Icb3387b4cd885b3652bae3f1da465d3e0f633332
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
Reviewed-by: Robert Loehning <robert.loehning@digia.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2013-07-02 12:09:43 +02:00
Nikolai Kosjar
1fad00f999 CppTools: Fix snapshot in case another project is opened
When a second project was opened the snapshot was reset. That resulted
in all kinds of problems since from then on the code model effectively
was not aware of the files of the first project.

The regression was introduced by commit a0d6df7b.

Change-Id: I1ccc9de68177205b49a4ba8ead2bc8abe4592b32
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
2013-06-28 17:54:53 +02:00
Przemyslaw Gorszkowski
68d6a762d9 C++: add support for local types
This change addes support for class, enum definition inside blocks({}) or
functions, e.g.:
void f()
{
	struct S
	{
		int bar;
	};
	S s;
	s.bar;
}

It fixes:
* code completion
* highlighting
* follow symbol
* marking
* find usages

It fixes also problem with namespace aliases inside blocks or functions.

This change can have also impact on performance(there are additional processing)

Task-number: QTCREATORBUG-166 (namespace aliases inside function/block)
Task-number: QTCREATORBUG-3620
Task-number: QTCREATORBUG-6013
Task-number: QTCREATORBUG-8020
Change-Id: Iaea6c6dfe276f1d7b2279b50bdd2e68e375d31eb
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2013-06-18 10:09:51 +02:00
Lorenz Haas
8f4c4b41f6 CppTools: Fix nextToSurroundingDefinitions
Now it is checked if the adjacent declaration is also defined and one
can define the destination file.

Change-Id: Ifff59c49fc2ab3e2f36f41df42ae4b7d7ff8dd35
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2013-06-12 16:32:14 +02:00
Nikolai Kosjar
50a900e509 C++: Handle recursive using/typedef declarations
Remember using/typedef declarations we have already looked up and
stop if we try it again.

Change-Id: I91bf0aef4df18539a47d015f0113543aef1f692a
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2013-06-11 16:30:58 +02:00
Nikolai Kosjar
8f1b665667 C++: Handle recursive auto declarations
Remember auto declarations we have already looked up and stop if we try
it again.

Task-number: QTCREATORBUG-9503

Change-Id: I989b11609c98bf197ce916d79c9d452294355053
Reviewed-by: Przemyslaw Gorszkowski <pgorszkowski@gmail.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2013-06-11 16:30:20 +02:00
Eike Ziller
d8bd56bcd6 Merge remote-tracking branch 'origin/2.7' into 2.8
Conflicts:
	src/plugins/cpptools/cppcompletion_test.cpp
	src/plugins/cpptools/cpptoolsplugin.h
	src/plugins/qbsprojectmanager/qbsbuildstep.cpp
	src/plugins/qbsprojectmanager/qbscleanstep.cpp
	src/plugins/qbsprojectmanager/qbsnodes.cpp
	src/shared/qbs

Change-Id: I8fc97ed61c47af2c3d9e5cc2bf81e97661204d4e
2013-05-24 16:20:10 +02:00
Przemyslaw Gorszkowski
a439d12b48 C++: fix typedefed struct
Fixed:
* replacing dot with arrow
* code completion

Task-number: QTCREATORBUG-7373
Change-Id: I6bd3781e91876567ce6f0d4160373438c756c417
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2013-05-24 11:46:48 +02:00
Przemyslaw Gorszkowski
783ec18424 C++: instantiate template functions
Task-number: QTCREATORBUG-9170

Change-Id: I4cac9124558c1d4f0722192246f3fbeea61d3d7d
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2013-05-24 11:43:52 +02:00
Przemyslaw Gorszkowski
80e1ae8059 C++: fix crash during code completion with base template class
ResolveExpression has to have a reference of ContextLookup. If not there
will be a crash because of deleted instanitated base template class.

Task-number: QTCREATORBUG-9329
Change-Id: I7f8c83da0d81ac6311e76d15a897adbc70b08d75
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2013-05-24 11:35:11 +02:00
Nikolai Kosjar
0d9bf5e543 C++: Fix 'already seen files' when indexing
Resetting the environment (after each *.cpp file) did not clear the
already seen files (m_included). Because of that the succeeding header
files were not parsed correctly - the environments of the mistakenly
already seen header files were not merged in.

Note that this change slow downs the parsing/indexing of files to its
original speed, as it was before the problematic commit (and it is in
2.7):

    commit 82e347095c
    C++: Untangle include file resolving from loading.

Task-number: QTCREATORBUG-9205
Change-Id: Iea57b7c59ea04a3c8843fd1291f4c375382958fc
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2013-05-23 08:37:36 +02:00
Przemyslaw Gorszkowski
5dbcb974b0 C++: added missing cloning of AnonymousNameId
When instantiate a template with anonymous class/struct/union
AnonymousNameId has to be cloned.

Task-number: QTCREATORBUG-9227

Change-Id: Iedca5e41589e68a94a35cd4387241052c70c50df
Reviewed-by: Sergey Shambir <sergey.shambir.auto@gmail.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2013-05-10 11:16:04 +02:00
Przemyslaw Gorszkowski
64d80150fa C++: fix code completion when 'using' declaration inside function
Looking for using declaration when lookup a type

Task-number: QTCREATORBUG-2668
Change-Id: I11600c5be262840472dd4c9e72334760a35aa4a0
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2013-05-02 10:42:19 +02:00
Nikolai Kosjar
849534ec6f Revert "C++: fix support for typedef of templated typedefs"
Still crashes when opening the Qt Creator project,
g++ (Ubuntu/Linaro 4.7.2-2ubuntu1) 4.7.2 (Ubuntu 12.10).

This reverts commit 564c9b2842.

Change-Id: Ief5c0aad463d245f68805f747d277ac298796c3d
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2013-04-23 12:36:06 +02:00