Commit Graph

1454 Commits

Author SHA1 Message Date
Leandro Melo
8a917b3011 C++: Fix add definitions on empty files
Task-number: QTCREATORBUG-7838

Change-Id: I8e9d452cf4c8ab5dd9f2a7f39d3802baf84609e1
Reviewed-by: David Schulz <david.schulz@nokia.com>
2012-09-12 14:39:35 +02:00
Nikolai Kosjar
9483408fec Locator on Linux/Mac: Show ~ instead of $HOME in paths.
With this, you will see more of the "relevant" path.

Change-Id: I03c4c7bd2bdaa9148c70a68678306e259f9c7204
Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
2012-09-11 15:42:58 +02:00
Eike Ziller
5ac721dd58 Merge remote-tracking branch 'origin/2.6'
Conflicts:
	qtcreator.pri
	qtcreator.qbp
	src/libs/utils/utils.pro

Change-Id: I6f0aba746f915d8c51dcf9372f7d9f593562fc2b
2012-09-11 14:02:03 +02:00
Christian Kandeler
0d2b1aedeb Remove "icheck build" test.
Does not build, is not being maintained, purpose is unclear.

Change-Id: I00f3bbc9580b57e3945882a411af502a78f4864f
Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
2012-09-07 12:30:25 +02:00
Leandro Melo
8ea4ed6b53 C++: Fix add definition test
To be consistent with the change 5b847a66df
in the InsertionPointLocator. Nevertheless, there are still issues to be
addressed in this class so we probably need more test cases when those
are handled.

Task-number: QTCREATORBUG-7833
Change-Id: Ie9abdd70566063a94350723432215d030c154fab
Reviewed-by: Christian Kandeler <christian.kandeler@nokia.com>
2012-09-07 10:13:20 +02:00
Christian Kandeler
b7a1e87cf4 Utils: Add user name accessor to the Environnment class.
Change-Id: Ic67381ab185525552eef948af602d00d3800b653
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-08-31 19:26:16 +02:00
Oswald Buddenhagen
a32e243e61 Merge branch '2.6'
Conflicts:
	src/libs/utils/consoleprocess_unix.cpp

Change-Id: I196f61e882bfce94e165d9c724bffee9df1011b7
2012-08-30 20:43:02 +02:00
David Schulz
33f8a42503 Editor: rename "Static" in Font & Colors settings
to more clearer "Enumeration"

Change-Id: I785edb6d31a4cd6a0875549f80bcf791ad61587a
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Leandro Melo <leandro.melo@nokia.com>
2012-08-29 11:21:58 +02:00
Christian Kandeler
e669f05406 Utils: Introduce HostOsInfo class.
The class' member functions are intended to be used
instead of the Q_OS_* macros in all contexts where
the latter are not syntactically required.
This lowers the likelihood of changes made on one
platform breaking the build on another, e.g. due to
the code model missing symbols in #ifdef'ed out code
when refactoring.

Change-Id: I4a54788591b4c8f8d589b8368a6c683d4155c9fa
Reviewed-by: hjk <qthjk@ovi.com>
2012-08-27 17:00:03 +02:00
Eike Ziller
bc67246432 Merge remote-tracking branch 'origin/2.6' 2012-08-23 15:52:15 +02:00
Leandro Melo
74a458bca0 C++: Improve completion when forward declarations present
This fixes one of the issues mentioned in the report below.
THe other part will come in a separate patch.

Task-number: QTCREATORBUG-7730

Change-Id: I9f56a9bcec8a881dab3ab60f40c5b71f296466da
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
2012-08-23 14:36:01 +02:00
Leandro Melo
11f6ae4a14 C++: Completion for templates as base classes
This fixes a variety of issues regarding class completion
when templates are used as base classes. The test cases
show examples.

Task-number: QTCREATORBUG-4357
Change-Id: I764d5ce817a78e1b19336e5beab758ca9e10f34b
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
2012-08-23 14:31:42 +02:00
David Schulz
0fcf5515e5 Fix display of default keyword in switch statement as a Label
Task-number: QTCREATORBUG-7172
Change-Id: I08a89cbef183e33300f72ea8cc2c0da9a23c5413
Reviewed-by: Leandro Melo <leandro.melo@nokia.com>
2012-08-17 11:13:20 +02:00
Eike Ziller
a54f9f1c54 Merge remote-tracking branch 'origin/2.6' 2012-08-15 12:11:26 +02:00
Orgad Shaneh
99aa8007c1 Remove NULL tests for Core::ICore::settings()
It cannot really be NULL

Change-Id: I7231e00754464347dc5750249f751cda7f831930
Reviewed-by: hjk <qthjk@ovi.com>
2012-08-09 13:09:08 +02:00
Eike Ziller
efefa2eb17 Merge remote-tracking branch 'origin/2.6' 2012-08-06 16:19:35 +02:00
hjk
6a7cf405bd rename QtDebug to QDebug
More uniform.

Change-Id: I1c6057981f4c2b3170a4e69f0674fe4caf1143a2
Reviewed-by: Robert Loehning <robert.loehning@nokia.com>
2012-08-06 14:55:08 +02:00
hjk
83e573f2ec use new id comparison operators to reduce line noise and save cycles
Change-Id: I2e7d81a4efb75877901d29964df4f71314e951b4
Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
2012-08-06 10:37:43 +02:00
Eike Ziller
9b3f183568 Merge remote-tracking branch 'origin/2.6' 2012-07-31 10:59:24 +02:00
Sergey Shambir
95c5ab2746 Added support for override/final and enum classes
Change-Id: I6dfe9dd606781046ff5a1ed61315741d2f332cb8
Reviewed-by: Christian Kamm <christian.d.kamm@nokia.com>
2012-07-30 09:42:30 +02:00
Konstantin Tokarev
16cf161d82 Changed URL to qt-project.org in pluginspecs.
Also, it's 2012 now.

Change-Id: I69a8d1d77658b2bb2cb547362d5e3163385cab3b
Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
2012-07-30 07:44:48 +02:00
Eike Ziller
42f4595e37 Merge remote-tracking branch 'origin/2.5'
Conflicts:
	src/libs/cplusplus/cplusplus-lib.pri

Change-Id: I430ec8c6dda4afad3aedb1bc47d3af64537cfe66
2012-07-24 14:17:33 +02:00
Christian Kamm
8dc0f69ed1 C++: Fix broken merge of 9121c21230.
Change-Id: I0cca1851132245430d59840728362ddea1475655
Reviewed-by: Christian Kamm <christian.d.kamm@nokia.com>
2012-07-23 07:19:26 +02:00
Christian Kamm
9121c21230 C++: Fix class scope completion for templates.
* You now get completion for std::vector<int>::[complete].
* Also added a test.

Conflicts:
	src/plugins/cpptools/cppcompletion_test.cpp
	src/plugins/cpptools/cpptoolsplugin.h

Change-Id: I596ebf6bd18ec9a347113f8d162cc124c8a0d6b4
Reviewed-by: hjk <qthjk@ovi.com>
2012-07-20 13:41:15 +02:00
Eike Ziller
e0e8cf3ada Contact -> qt-project.org
Change-Id: I7134d7de30bcf9f9dcfad42520dd45ee083a852d
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-07-19 13:23:21 +02:00
Leandro Melo
441c652ce5 C++: Change back highlighting of types
The type highlighting change part of the recent patch
4a2a17af8a didn't seem to
please much from a visual point of view. It's a better
idea to keep the type highlighting as it was for now
and in the future try again the approach with an explicit
option and perhaps a more restrictive context.

The other patch is not reverted entirely because it does
fix a couple of bugs.

Change-Id: I806afa3d8c1c4b241080b8704255d737f61ee12c
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
2012-07-17 16:23:52 +02:00
Leandro Melo
4a2a17af8a C++: Changes in semantic highlighting
- Fix issues with virtual/non-virtual destructors. They were not
  being correctly identified in some cases - in particular on certain
  uses in derived classes.

- Since now we do have a highlighting item for regular functions,
  constructors and destructors are now highlighted as such. This is
  more semantically correct and actually makes navigation and readiblity
  more distinguishable, since it cleary differentiates the type itself
  from its uses in expressions and declarators. (This seems to be what
  other IDEs like Eclipse, Visual Studio, KDevelop are doing.)

  NOTE: There's a switch to disable this item in the case it doesn't
  get good acceptance. Actually, the switch can be made a user
  setting...?

- Change the default color scheme so regular and virtual functions
  have the same color (virtuals continue to be italic). This makes
  sense given the above mentioned changes in constructors/destructors
  highlighting behavior. (In other schemes virtual funcions don't have
  different color, so this shouldn't be necessary in those.)

- Small renaming: "members" are now "fields" - consistent, since
  they apply for data and it's the term used in the UI.

Change-Id: Ib1aa9c0bbf28a31d09f5696460b0095fbe29de80
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
2012-07-17 13:53:19 +02:00
Sergey Shambir
edabcb40fa Added tooltips on completions proposals
Change-Id: Ic22b99e25159edfa4977e13c98f334ce75809af7
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
2012-07-17 10:19:43 +02:00
Leandro Melo
7d63548964 C++: Fix potentially infinite loop in completion
Could be reproduced in code as below (cursor at |):

    QFormLayout|formLayout *fl = new QFormLayout(this);

Change-Id: I7f5e9ac8ff8dfffbca63d7ab9f837333440c9810
Reviewed-by: hjk <qthjk@ovi.com>
2012-06-29 15:41:40 +02:00
Tobias Hunger
bf880ee8b0 Remove unused member variables
Change-Id: I60b95723813cc660d7907fa6f06c6452dc959fe4
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
2012-06-29 13:57:40 +02:00
Nicolas Arnaud-Cormos
62a22e0aa3 Don't cache mapping between source and private header
When switching from a header to a source file, the source->header
mapping is cached. It's not the case anymore for private headers (_p).

Change-Id: I481c0613e29db0a3fb4e17f339626abb49ffa8e2
Reviewed-by: Leandro Melo <leandro.melo@nokia.com>
2012-06-28 17:14:50 +02:00
Leandro Melo
04094c274e C++: Enable C++11 keywords in macro uses
Just in case compilers id defining such things.

Change-Id: Ica6af8462e90bfab2bfa883ec12d5e648d6d33db
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
2012-06-28 13:50:36 +02:00
Leandro Melo
d6ccffc06c C++: Core changes in preprocessing
Summary of most relevant items:

- Preprocessor output format change. No more gen true/false. Instead
  a more intuitive and natural expansion (like from a real compiler) is
  performed directly corresponding to the macro invocation. Notice that
  information about the generated tokens is not lost, because it's now
  embedded in the expansion section header (in terms of lines and columns
  as explained in the code). In addition the location on where the macro
  expansion happens is also documented for future use.

- Fix line control directives and associated token line numbers.
  This was not detected in tests cases because some of them were
  actually wrong: Within expansions the line information was being
  considered as originally computed in the macro definition, while
  the desired and expected for Creator's reporting mechanism (just
  like regular compilers) is the line from the expanded version
  of the tokens.

- Do not allow for eager expansion. This was previously being done
  inside define directives. However, it's not allowed and might
  lead to incorrect results, since the argument substitution should
  only happen upon the macro invocation (and following nested ones).
  At least GCC and clang are consistent with that. See test case
  tst_Preprocessor:dont_eagerly_expand for a detailed explanation.

- Revive the 'expanded' token flag. This is used to mark every token
  that originates from a macro expansion. Notice, however, that
  expanded tokens are not necessarily generated tokens (although
  every generated token is a expanded token). Expanded tokens that
  are not generated are those which are still considered by our
  code model features, since they are visible on the editor. The
  translation unit is smart enough to calculate line/column position
  for such tokens based on the information from the expansion section
  header.

- How expansions are tracked has also changed. Now, we simply add
  two surrounding marker tokens to each "top-level" expansion
  sequence. There is an enumeration that control expansion states.
  Also, no "previous" token is kept around.

- Preprocessor client methods suffered a change in signature so
  they now receive the line number of the action in question as
  a paramater. Previously such line could be retrieved by the client
  implementation by accessing the environment line. However, this
  is not reliable because we try to avoid synchronization of the
  output/environment lines in order to avoid unnecessary output,
  while expanding macros or handling preprocessor directives.

- Although macros are not expanded during define directives (as
  mentioned above) the preprocessor client is now "notified"
  when it sees a macro. This is to allow usage tracking.

- Other small stuff.

This is all in one patch because the fixes are a consequence
of the change in preprocessing control.

Change-Id: I8f4c6e6366f37756ec65d0a93b79f72a3ac4ed50
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
2012-06-25 15:49:27 +02:00
Leandro Melo
93894ab160 C++: Do not reuse content in completion if it's unfinished identifier
Taskn-number: QTCREATORBUG-7521

Change-Id: I7b8edb93d143f599c93a82c82bf2c0d49c8e49e9
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
2012-06-20 16:08:23 +02:00
Eike Ziller
e3c354d8f2 Make PluginManager mostly static.
Change-Id: Ib938aa4999c7c418a82304c5cca2e8748ef9d228
Reviewed-by: hjk <qthjk@ovi.com>
2012-06-19 16:11:40 +02:00
Yuchen Deng
0d20c5b796 Fix qbs code style
Change-Id: Ia3e4df528d391580064efbeeab75016335a4299d
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-06-19 11:22:40 +02:00
Leandro Melo
23c637c4f6 C++: Introduce unicode char/strings support
Those are the types char16_t and char32_t along with the new
char/string literals u'', U'', u"", u8"", and U"".

This is particularly important for the use of QStringLiteral
since in some platforms it relies on expansion such as above.

Note: The string literals quickfixes still need some tunning.

Task-number: QTCREATORBUG-7449
Change-Id: Iebcfea15677dc8e0ebb6143def89a5477e1be7d4
Reviewed-by: hjk <qthjk@ovi.com>
2012-06-06 14:55:07 +02:00
Andre Hartmann
44a3a5e070 Implemented Rename Macro Usages
Works the same way as Rename Usages for C++ Symbols.

For now, no Search Again as this requieres further work.

Task-number: QTCREATORBUG-413

Change-Id: I09e85ea1e8c247f5ce0b6bc566aba8018c1569e4
Reviewed-by: Leandro Melo <leandro.melo@nokia.com>
2012-06-06 14:10:07 +02:00
Eike Ziller
ddc0c89bd6 Show warning with continue/cancel in case of many search results
Task-number: QTCREATORBUG-6116
Change-Id: I57a66b8989f1cc4137b02df370704dfe43d392ac
Reviewed-by: Robert Löhning <robert.loehning@nokia.com>
Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
2012-06-05 10:08:40 +02:00
Francois Ferrand
809611f346 CppHighlighter: highlight all functions/methods.
- Highlight all function/methods (not just virtual methods).
- Highlight as a function even if number of arguments does not match. In
  that case, add a diagnostic message to indicate there are too many/too
  few arguments.
- Fix highlighting of parameters in function declarations.
  These used to be handled indiferently, and they could be mistaken for
  type or field references.
- Properly highlight template method calls.

Change-Id: I6e61c9ee47763db95c62314f9cc1c4d398df38b3
Reviewed-by: Leandro Melo <leandro.melo@nokia.com>
2012-06-05 09:30:54 +02:00
Leandro Melo
ca7ac8c035 C++: Fix macro uses line info
Make sure the environment line is consistent during preprocessor
directives and identifier handling so clients can rely on consistent
information. Particularly important for macro usages.

New tests also added.

Change-Id: I962a39a86cd17b8d945d2959c2c95e2d258ea3e6
Reviewed-by: hjk <qthjk@ovi.com>
2012-06-01 14:28:03 +02:00
Eike Ziller
3934347fe9 ActionManager API cleanup.
d-pointer instead of inheritance
static methods

Change-Id: I7b2f0c8b05ad3951e1ff26a7d4e08e195d2dd258
Reviewed-by: hjk <qthjk@ovi.com>
2012-05-25 10:08:24 +02:00
hjk
f77cd29e54 IOptionsPage: replace virtual fuctions by data members
Change-Id: I8297df85109b67b79f90c33263a5dc7b89efbb60
Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
2012-05-23 10:48:04 +02:00
Eike Ziller
8a7bc472dc Mark canceled searches as such.
Task-number: QTCREATORBUG-6820

Change-Id: Ic14c0ea6f26e4a05c642012b87578f30c817fef7
Reviewed-by: Robert Löhning <robert.loehning@nokia.com>
Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
2012-05-22 13:41:46 +02:00
hjk
21bf0046c3 editormanager: simplify use of interface
Less code on the user side, same meaning.

Change-Id: I14e54a5d2ed8e024a51cce74eaf7c8419ad544be
Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
2012-05-11 13:51:14 +02:00
Bradley T. Hughes
fb9146a9c3 Compile after qt5/qtbase commit 75a0c7f9
Commit 75a0c7f9b52cde47f20fdc1b89e1264d60350848 in qt5/qtbase changed
some QRegExp methods to be non-const (they were previously const). This
change makes Qt Creator compile again.

Change-Id: Ibc98c678126c3b3189df7fcc043463b940951445
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
2012-04-30 14:32:08 +02:00
hjk
6d393252c4 preprocessor: rename operator() into run.
Easier to follow.

Change-Id: I6da1ca862ddb7048a6d16bf5e6ea18d6b2cfc7f8
Reviewed-by: hjk <qthjk@ovi.com>
2012-04-19 19:37:14 +02:00
hjk
acf6f8f0cb preprocessor: make Environment::{resolve,remove} work on ByteArrayRefs only
Change-Id: Idb93d359bd45696a38cb863dcea30c5c377eeabb
Reviewed-by: hjk <qthjk@ovi.com>
2012-04-19 18:41:18 +02:00
hjk
17c114fde8 preprocessor: make CPlusPlus::Internal::ByteArrayRef public
Change-Id: Ief6ea71f750b6ba19b650050bae376f4ad82d9d2
Reviewed-by: hjk <qthjk@ovi.com>
2012-04-19 18:37:31 +02:00
hjk
d4b4a75603 preprocessor: save cycles by using ByteArrayRef
Change-Id: I339696763b045ef1bda17dd55746738ef4ddbb67
Reviewed-by: hjk <qthjk@ovi.com>
2012-04-19 18:36:33 +02:00