Commit Graph

1024 Commits

Author SHA1 Message Date
Nikolai Kosjar
a9c15c0bf5 C++: Remove Lexer::{tokenOffset(),tokenLength()}
The necessary data can be retrieved by the resulting Token.

Change-Id: I79afb23183c156240c690beff30bb11dfe943e61
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2014-05-15 14:48:03 +02:00
Nikolai Kosjar
d84bd0b359 C++: Remove unused functions in Document::Block
Change-Id: I7049388d970c2c1454a95f0a0df6cfd8f5a960a8
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2014-05-15 14:47:20 +02:00
Alessandro Portale
551f7e1caf QString(QLatin1String()) -> QString::fromLatin1()
Change-Id: I93bdd926ca1c7a37a298335711069d985f1f91dd
Reviewed-by: hjk <hjk121@nokiamail.com>
2014-05-09 09:03:19 +02:00
Eike Ziller
8c1c106a4f Merge remote-tracking branch 'origin/3.1' 2014-04-14 16:53:23 +02:00
Nikolai Kosjar
697ec70037 Revert "C++: nested class with enclosing template class"
This reverts commit 5d76b4339a since it
might lead to an infinite loop.

Task-number: QTCREATORBUG-11999
Change-Id: I12c7f3afc4aa53a83ddc2bf2d33eb76c29b747ee
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2014-04-09 17:32:04 +02:00
Eike Ziller
b687658663 Merge remote-tracking branch 'origin/3.1'
Conflicts:
	qtcreator.pri
	qtcreator.qbs
	src/plugins/cpptools/cppcompletion_test.cpp

Change-Id: Ic5e75b3ef164de664a1449ffa8579beaf5b02521
2014-04-08 11:18:40 +02:00
Nikolai Kosjar
08c4bf3336 C++: Remove unused functions
Change-Id: I642f681454ae1d3e684b4c40aec7820ba3a803ad
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2014-04-07 16:47:29 +02:00
Przemyslaw Gorszkowski
5d76b4339a C++: nested class with enclosing template class
The parent of instantiation of nested class of template class
should be the instantiation of enclosing template class.

Task-number: QTCREATORBUG-11752
Change-Id: I8875c738848b85731f5ea88a60da190b4b0ad18f
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2014-04-04 12:11:19 +02:00
Przemyslaw Gorszkowski
faca3333b5 C++: fix typedef resolving
Fix a case:
struct A
{
  int a;
};

typedef A B;
typedef B* Bptr;
Bptr b;
b->

Task-number: QTCREATORBUG-10021
Change-Id: Ibf5ca801dbdb72744416924c0b8fc03daad5948a
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2014-04-04 12:11:02 +02:00
Przemyslaw Gorszkowski
df5d9f99fb C++: fix findusage for member of typedefed anonymous struct
Task-number: QTCREATORBUG-11859
Task-number: QTCREATORBUG-11860
Change-Id: I7484b3b88daefbb3c76bb86a9b573e8291072872
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
(cherry picked from commit 5416557a0b)
Reviewed-by: Przemyslaw Gorszkowski <pgorszkowski@gmail.com>
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2014-04-04 12:07:06 +02:00
Przemyslaw Gorszkowski
5416557a0b C++: fix findusage for member of typedefed anonymous struct
Task-number: QTCREATORBUG-11859
Task-number: QTCREATORBUG-11860
Change-Id: I7484b3b88daefbb3c76bb86a9b573e8291072872
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2014-03-31 18:16:52 +02:00
Oswald Buddenhagen
f013c41d05 Merge remote-tracking branch 'origin/3.1'
Conflicts:
	src/plugins/cmakeprojectmanager/cmakeopenprojectwizard.cpp

Change-Id: Icce6e8dd9b3afd9a0fe836e9babfb7a17cee9c4d
2014-03-27 18:20:00 +01:00
Erik Verbruggen
b0618281ec C++: Do type and name equality checking in a safe manner.
Change the TypeMatcher to also match names, and use two "block" lists
in SafeMatcher to prevent infinite recursion.

Task-number: QTCREATORBUG-11240
Change-Id: I0367ae795ee6be579b83aeb8d46723c877e4aa75
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2014-03-27 13:46:55 +01:00
Przemyslaw Gorszkowski
6bf75acac7 C++: fix support for nested anonymous class
The case when anonymous class is inside function. Fixed:
* highlighting
* completion

Task-number: QTCREATORBUG-11711
Change-Id: Ic8fc5fdfb1aed62a74bf148ab7ed449d08214dda
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2014-03-26 09:56:54 +01:00
Przemyslaw Gorszkowski
e3f5977311 C++: nested class in function
Case when nested class declaration contains object name for this class.
Example:
void fun()
{
    struct S
    {
        int i;
    } s;
    s.i;
}

Fixes:
* highlighting
* completion
* tests

Task-number: QTCREATORBUG-11710
Change-Id: I32e234f57655c388a87a199edc8be750d7bf823f
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Przemyslaw Gorszkowski <pgorszkowski@gmail.com>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2014-03-25 15:52:39 +01:00
Przemyslaw Gorszkowski
5d3c070174 C++: Do not set binding block as instantiationOrigin
The binding in a block should not be used as an instantiationOrigin,
because it will be deleted if it does not contain any blocks or
namespaces or classes or enums.
Instead of that we should look for first enclosing class or namespace.

Task-number: QTCREATORBUG-11424
Change-Id: I0fc6e935495478f71372b0fe6f611887f45b2eda
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2014-03-25 15:08:35 +01:00
Oswald Buddenhagen
868428cc63 Merge remote-tracking branch 'origin/3.1'
Conflicts:
	qbs/imports/QtcTool.qbs
	src/plugins/git/giteditor.cpp
	src/plugins/qmldesigner/qmldesignerplugin.cpp

Change-Id: Icafd32f713effb1479480a0d1f61a01e429fbec0
2014-03-18 14:46:29 +01:00
Przemyslaw Gorszkowski
376f77952e C++: fix support for nested anonymous classes
A member of nested anonymous class should be visible as a member of
enclosing class(if there is no declaration of this nested anonymous
class).

Fix:
* marking
* find usage
* follow symbol
* completion

Task-number: QTCREATORBUG-10876
Task-number: QTCREATORBUG-11170
Change-Id: If5b4d198e9075f2a8aa899ae59190f2c05f7b1ff
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Przemyslaw Gorszkowski <pgorszkowski@gmail.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2014-03-12 14:07:58 +01:00
Joerg Bornemann
84df758ec6 use new base import style in qbs files
Change-Id: Iecf32122df41f304ec6df538bb0dd8a263238a86
Reviewed-by: Jake Petroules <jake.petroules@petroules.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2014-03-11 14:20:22 +01:00
Oswald Buddenhagen
52bf71fbdf Merge remote-tracking branch 'origin/3.1'
Conflicts:
	README
	tests/auto/debugger/tst_dumpers.cpp

Change-Id: Ib9aef37a246bc3bb9bca0c32a902af3b09ef3146
2014-03-11 13:39:55 +01:00
Sergio Ahumada
c375436847 Fix some typos
Change-Id: I3be73c2a4d256a0d28e863fd2517a4d7442b34d8
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com>
2014-03-05 09:39:42 +01:00
Eike Ziller
92e930b367 Merge remote-tracking branch 'origin/3.1' 2014-02-28 13:53:42 +01:00
Friedemann Kleint
f5c57e039c Fix compilation of C++-library with Qt 4.
TypeOfExpression.cpp:64:20: error: ‘class QSharedPointer<CPlusPlus::CreateBindings>’ has no member named ‘reset’

Change-Id: Ifee13f58dd7e740241231019bbbbeb38ccfbe3d9
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-02-28 09:51:31 +01:00
Orgad Shaneh
c6ca15dc15 C++: Record macro uses in #if defined(MACRO)
Change-Id: I4d99053f540073483c16ce842426bf8cd3def421
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2014-02-27 21:08:34 +01:00
Orgad Shaneh
b41b25a3f7 C++: Fix line value for tokens generated by function-like macro
baseLine is used for generating new tokens, which are
later added m_state.m_lineRef - 1 again

Change-Id: I33928a90988e8d4c317ae460647f16f87da5b155
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2014-02-27 20:55:58 +01:00
Eike Ziller
f5fdc07d47 Merge remote-tracking branch 'origin/3.1' 2014-02-27 17:13:27 +01:00
Orgad Shaneh
5d2cd2e56d C++: Fix handling of #undef
* If the macro is defined before, track its reference
* Synchronize environment line before calling remove, which
  currently sets incorrect line
* Set macro offset

Task-number: QTCREATORBUG-10454
Change-Id: I480d16423a976a025bb8c71046610a46f9d7b0fd
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2014-02-27 16:13:51 +01:00
Erik Verbruggen
e61d688025 C++: cleanup setting the bindings in the lookup context class.
Change-Id: I114d7b1116ee5e345675a332c30312614c0faf5f
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2014-02-27 15:58:50 +01:00
Orgad Shaneh
67caa75c56 C++: Fix preprocessing of uncontinued line-escaping
The following snippet demonstrates the problem:

--- snip ---
// comment \

#include <something.h>
...

class Foo
{
    ...
};
--- snap ---

If there are >=9 empty/preprocessor lines, the preprocessed source
becomes
// comment \
# 12 "file.cpp"
...

The lexer considers the line marker as a continued C++ comment, and
highlighting is broken

Change-Id: I30a2fc7d19b279316e9273697179c90d81099573
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2014-02-24 21:56:52 +01:00
Orgad Shaneh
dabdb60299 C++: Preserve comments after preprocessor directives
Task-number: QTCREATORBUG-11216
Change-Id: Iac10e75f0f5c504b79e8466607dc1f478e578f99
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2014-02-24 21:56:40 +01:00
Orgad Shaneh
6133920bfe Preprocessor: Adjust lines also for multiline C++ comments
Change-Id: I87d6e76be3030e617603209c3a1b8b3c476cf1f6
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2014-02-24 21:56:23 +01:00
Fawzi Mohamed
d24cb60d48 qml: moving most of ModelManager logic to ModelManageInterface
Currently ModelManager contains lot logic, but as it sits in QmlJSTools
it is not possible to use it in standalone tests.
Moving most of the logic to ModelManagerInterface (and cleanup)
to allow better testing, and refactoring.
This introduces a dependency of the qmljs lib on the cplusplus lib
Also a (small) part of the CppTool::ModelManagerInterface has been
moved to CPlusPlus::CppModelManagerBase to remove the dependency on
CppTools to gather the Qml types exposed from C++.

Change-Id: Icad7fe96dfd0f1a2b1058d82bd98c77c40aa5e9d
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
2014-02-19 21:18:58 +01:00
hjk
df2ecb4edd Move the textual simplification of container type to debugger again
This is the only user, and likely will stay so for a while, and
eases the linking of the debugger autotests.

Change-Id: I822fa892f105a5b7985370b26e50aa94cac74bb3
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2014-01-08 14:49:35 +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
Daniel Teske
a1c18d9e97 TypeRewriter: Handle rvalue references correctly
Task-number: QTCREATORBUG-10555
Change-Id: Icb9859f96220f613476c097b747dec8c2d1bc2ed
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2014-01-03 15:19:08 +01:00
Nikolai Kosjar
796fcaf1d2 Revert "C++: Fix highlighting for lines with predefined macros"
This takes too much memory. For qtcreator.pro the numbers are as
follows:

    Patch applied:  ~ 1600MB (RES)
    Patch reverted: ~  510MB (RES)

This reverts commit 4c2daa90ce.

Task-number: QTCREATORBUG-10973
Change-Id: I843bd7c1ea4a26a1ec55ddc14c2a34a98d040922
Reviewed-by: hjk <hjk121@nokiamail.com>
Reviewed-by: Robert Loehning <robert.loehning@digia.com>
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2013-12-03 09:53:26 +01:00
hjk
9a9ec06d48 CPlusPlus: Remove unneeded declarations
Change-Id: I5bf4febd1ec3b77e05f883015a99ed019ddfb55c
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2013-12-02 15:38:02 +01:00
Nikolai Kosjar
4c2daa90ce C++: Fix highlighting for lines with predefined macros
This adds definitions for the macros __FILE__, __LINE__, __DATE__ and
__TIME__ on demand.

As a side effect, this also introduces highlighting for the uses of
these macros.

Task-number: QTCREATORBUG-8036
Change-Id: Ib7546c7d45d2eecbc50c7883fc684e3497154405
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
Reviewed-by: hjk <hjk121@nokiamail.com>
2013-11-29 15:11:27 +01:00
Nikolai Kosjar
4edfe87b58 Revert "Preprocessor Enginge: fix bug in pp-engine.cpp"
Breaks highlighting for macros using the predefined macros.

This reverts commit 1d834c1126.

Change-Id: Ic13c407e293a806a63ff30153864530df6a32e47
Reviewed-by: hjk <hjk121@nokiamail.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2013-11-29 15:11:10 +01:00
Simon Schäfer
1d834c1126 Preprocessor Enginge: fix bug in pp-engine.cpp
Preprocessor variables __LINE__,__FILE__,__TIME__,__DATE__ where destroying
the following systems when affected variables were standing  within the
same line with those variables:
* highlighting
* refactoring
* local renaming

Task-number: QTCREATORBUG-8036
Change-Id: I1a4b919d15812872ca5a8e63b1031ec1ab144c22
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2013-11-28 11:40:37 +01:00
Daniel Teske
87fba6606f TypePrettyPrinter; Add space to default parameter formatting
Task-number: QTCREATORBUG-10230
Change-Id: Ib93b9438a20f66cd3c9acc0ff074c78fff430337
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2013-11-26 17:12:42 +01:00
Orgad Shaneh
4442a92729 Braces cleanup
Change-Id: I8413252c90a1487d291f15d92837c30ab697b245
Reviewed-by: hjk <hjk121@nokiamail.com>
2013-11-14 08:13:52 +01:00
Nikolai Kosjar
0c16757085 C++: Remember the class a ClassOrNamespace is based on
Change-Id: I0d333ff9489e46c4fa1923d70ca950f67ffa3f44
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2013-11-12 16:42:22 +01:00
Erik Verbruggen
d57b405f29 CppTools: fix inclusion of "injected" defines.
Task-number: QTCREATORBUG-10280

Change-Id: Ibc6ffeedb97a31a35a2d1f00625506f844692e16
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2013-10-23 12:52:40 +02: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
Nikolai Kosjar
d808ebed88 CppEditor: Fix crash in CompleteSwitchCaseStatement
Task-number: QTCREATORBUG-10366

Change-Id: I6d5af5e7a59f3867141c8d7f098128d3db532ee5
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2013-10-17 12:04:42 +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
hjk
2b532c73ee CPlusPlus: Make (sub-)languague selection more generic
Change-Id: I4e2df6992b446adec662ab07671acd41715e41fd
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2013-10-15 16:22:28 +02:00
Nikolai Kosjar
b8dbac0b9c Rename "[Mm]ethod(s)" to "[Ff]unction(s)"
Only methods as programming functions are affected. Besides renaming
some actions like "Switch Between Function Declaration/Definition" this
mostly touches (api) code comments.

This is a follow-up patch to commit 872bfb7.

Change-Id: Icb65e8d73b59a022f8885b14df497169543a3b92
Reviewed-by: hjk <hjk121@nokiamail.com>
2013-10-10 15:56:12 +02:00