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>
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>
...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>
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>
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>
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>
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>
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>
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>
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>
(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>
...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>
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>
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>
* 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>
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>
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>
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>
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>