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>
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>
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>
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>
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>
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>
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>
Looking for using declaration when lookup a type
Task-number: QTCREATORBUG-2668
Change-Id: I11600c5be262840472dd4c9e72334760a35aa4a0
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
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>
Fix instantiation of templates(by cloning original symbols). Assigning of scope
for cloned symbol is taken from the symbol which is used to instantiate.
Task-number: QTCREATORBUG-9098
Change-Id: I066cc8b5f69333fabdaf2d4466b205baf08bd3f1
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
System headers and other file which are not explicitly mentioned in the
project must be reparsed when the project changes.
Task-number: QTCREATORBUG-9056
Change-Id: I32f1206d241a078a4d9b15fac5813f365a1ba303
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
Ran script to remove inludes on a trial-and-error basis and
manually corrected it.
Change-Id: Ic8464ea084ca1ab401e9f4a7d0183b92b4038902
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
... and adjust INCLUDEPATH accordingly.
while i'm at messing with include statements, also re-order the include
blocks according to policy and sort them within bigger blocks.
Change-Id: I7762abfd7c4ecf59432b99db2f424e4fa25733a5
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
Fix resolving typedef of templates which is from different namespace
and there was 'using' used for it.
Examples are in tests.
Another step to bring code completion for stl containters.
Task-number: QTCREATORBUG-7978
Change-Id: I2e9e71b45d60536c1e25cf2d371c4719b15edf79
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
Unit test describe this complex typedef. Another step to bring
code completion for stl containers.
Change-Id: I27985c4ea7c26c723d7a88ce42c5ecf164b6c903
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
Cleanup code and added shortcuts and menu entries for
- open header/source in next split
- follow symbol under cursor in next split
- open declaration/definition in next split
Change-Id: I2c4347749d26669d88b7c2968f30f60710f442b1
Reviewed-by: Petar Perisin <petar.perisin@gmail.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
- Abort on expanded tokens
- Abort on simple declarations starting with "class"/"struct"/"enum"
- Abort if rewritten declaration does not contain '*'/'&'
Change-Id: Ifddb6f20d6bc5c0afc3fcd1d742615198515a04c
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
Fix code completion and highlighting member of typedefed pointers.
It works when typedef is inside or outside of the function.
Task-number: QTCREATORBUG-8671
Task-number: QTCREATORBUG-8672
Change-Id: I9cc87080bf443f7ffa6a90ef5ba582b87700f2db
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
Fix code completion for instantiation of template with default argument
Change-Id: I57b0306cc4540400ae83724db6c8b6b1aa67c255
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
It works for full specialization. Instantiate of the partial
specialization has to be implemented(finding appropriate partial
specialization-on going)
Added unit test.
Change-Id: I8ef5ea963e7c665e0d67d390b3a833486773dab0
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
For a given AST, CppRefactoringFile and Overview this will create a
ChangeSet for rewriting the pointer or reference declaration according
to the Overview.
Task-number: QTCREATORBUG-6169
Change-Id: If6f824c1ea5e9f53a11a58ec8b6d696d01f0723e
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
Added unit test for code completion when pointer's type is a typedef
Change-Id: I408be8d9364a4b48824238dcc44175167ae653f4
Reviewed-by: hjk <qthjk@ovi.com>
Included unit tests.
Task-number: QTCREATORBUG-8368
Change-Id: I1b04124bc2c9eac050cfb2e6d3a5c1aca5311f4b
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
Fix code completion for operator '->' when
returned value is a pointer of typedef(e.g.:std::auto_ptr).
Included unit test.
Task-number: QTCREATORBUG-629
Change-Id: I36b53a3f80b3c99d52791e18ad1244923c1373f6
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
This change solves only problem with Qt containers.
stl containers need separate change.
Problem was with predeclaration of template class after
declaration of this template class.
(there is unit test added which shows the problem).
Task-number: QTCREATORBUG-8228 (cover only Qt containers)
Change-Id: If1f76c88c955b7b55347d302b353f5cd52b244a4
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
Conflicts:
src/plugins/cpptools/cppcompletion_test.cpp
Change-Id: I9f665276926f2e440ad0c92e94dd1aeee89005b3
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
This change solves only problem with Qt containers.
stl containers need separate change.
Problem was with predeclaration of template class after
declaration of this template class.
(there is unit test added which shows the problem).
Task-number: QTCREATORBUG-8228 (cover only Qt containers)
Change-Id: If1f76c88c955b7b55347d302b353f5cd52b244a4
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
Unit tests for code completion for nested class when enclosing is a template
Change-Id: I409f742923468db23dd9a8e4c18cbb21b1e52dd9
Reviewed-by: hjk <qthjk@ovi.com>