Commit Graph

1454 Commits

Author SHA1 Message Date
Francois Ferrand
85609aff8e CppHighlighter: highlight macro references.
Change-Id: I7c90957aa67e03a109af0a722160d4e1c759d716
Reviewed-by: Leandro Melo <leandro.melo@nokia.com>
2012-04-13 02:07:37 +02:00
Joerg Bornemann
96a7fbe3ae qbs files: use Qt5 module dependencies
Renamed gui -> widgets.
Renamed declarative -> quick1.

With qbs the usage of qt.widgets and qt.quick1 with Qt4 is supported.

Change-Id: I6cadaf34527f1f880d74ced7d2d18dd9801b7de1
Reviewed-by: Alessandro Portale <alessandro.portale@nokia.com>
2012-04-10 18:02:39 +02:00
Andre Hartmann
998e4ae139 Fix C++ Macro Usages definition line in Search Results.
Add the complete line to the Search Results window,
including '#', "define", macro and macro value and
all possible white spaces between them.
Also covers the case of line continuation in macro
definitions from commit 3dec48557a.

Task-number: QTCREATORBUG-7217

Change-Id: I8b9d0c23d31ef76244833a9b9d67469c5c4a5635
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
2012-04-04 09:12:59 +02:00
Erik Verbruggen
31fc4c41b8 [C++] Added env. var. to show file name that is being parsed.
When setting the environment variable
QTCREATOR_DUMP_FILENAME_WHILE_PARSING, the indexer will write the file
name of the file it is processing to stderr.

Change-Id: Iaed582512b87fd0584feb4e459a4094be32d5745
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
2012-03-30 10:10:27 +02:00
Erik Verbruggen
210c191216 Revert "CppHighlighter: highlight all functions/methods."
This reverts commit e3e67467cfea5934f16a95385761455b0c495a0d

Reason is that it shows errors for calls to function-like macros. For example, any use of Q_DISABLE_COPY results in invalid errors.

Change-Id: I1fd1473ac5a30da5b9aebf6a3f0f11055bdbe8ad
Reviewed-by: Erik Verbruggen <erik.verbruggen@nokia.com>
2012-03-29 15:53:23 +02:00
Francois Ferrand
e639a2381f 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: I6ab463996dda47554839f482da47f561f76663a7
Reviewed-by: Erik Verbruggen <erik.verbruggen@nokia.com>
2012-03-29 14:53:48 +02:00
Andre Hartmann
3dec48557a Fix C++ Macro Usages when Definition contains Newline.
Now truncates the displayed line at the first Newline character after
the Macro name.

Task-number: QTCREATORBUG-7113

Change-Id: Ifb13c01d10b97098b54ac4346a80f0dcff3a35f3
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@nokia.com>
2012-03-29 14:34:39 +02:00
Erik Verbruggen
60db573660 [C++] Rewrite of the preprocessor.
This rewrite fixes a couple of issues with the pre-processor. It now
supports:
- macros in macro bodies
- stringification of parameters [cpp.stringize]
- the concatenation operator [cpp.concat]
- #include MACRO_HERE
- defined() inside macro bodies used in pp-conditions.

Change-Id: Ifdb78041fb6afadf44f939a4bd66ce2832b8601f
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
2012-03-29 14:28:17 +02:00
Eike Ziller
8f6d915948 Merge remote-tracking branch 'origin/2.5' 2012-03-28 16:31:29 +02:00
Erik Verbruggen
0f21515277 Fix: do not put in duplicate definitions.
Change-Id: Ia3f248d013a1b4f98ad3e85d13cfcf214d3c97c7
Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
2012-03-28 13:34:16 +02:00
Eike Ziller
dc49fdd5ed Don't pass native file names to internal API.
Task-number: QTCREATORBUG-7191

Change-Id: I89889a3580f4a27a912eacb09e893b428c5c5351
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
2012-03-27 11:18:55 +02:00
Erik Verbruggen
e685a96da6 Fixed debug output.
Change-Id: I2edff4126f3504661957529c198a1fc1ea169a08
Reviewed-by: Erik Verbruggen <erik.verbruggen@nokia.com>
2012-03-27 10:08:48 +02:00
Marco Bubke
d3e25481f9 Fix qbs project files
Change-Id: Iae72cd8f65779617dfa3ae03e9c894a95d151e81
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-03-21 10:58:06 +01:00
Francois Ferrand
1e7a0d3f65 CppEditor: do not highlight generated local symbols.
Change-Id: I75a1ed30cbc4d329f65901b856bc19b95e711f3e
Reviewed-by: Erik Verbruggen <erik.verbruggen@nokia.com>
2012-03-20 14:06:17 +01:00
Andre Hartmann
04679f8071 Improved highlighting in C++ Macro Usages.
Only highlight the Macro name, not the whole definition line
or the parameter list in function-like Macros.

Change-Id: I5732dd5dd18cee150755ea35a5fbb67fdaed51c4
Reviewed-by: Francois Ferrand <thetypz@gmail.com>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Leandro Melo <leandro.melo@nokia.com>
2012-03-16 15:11:07 +01:00
Erik Verbruggen
dfd28a1d32 Fix build breakage after making plugins dependent on cpptools.
Change-Id: Iae2c15efe25580fb616bdc3dd4b8ff3581cd481a
Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
2012-03-15 15:28:17 +01:00
Eike Ziller
e5e3f91ed2 Merge remote-tracking branch 'origin/2.5'
Conflicts:
	src/libs/qmljsdebugclient/qmlprofilereventlist.cpp

Change-Id: Ic6251d47ecd032ea1db4fc58dc80e19b6e6cf23d
2012-03-15 15:01:54 +01:00
Erik Verbruggen
51de4ed21a Add flag for semantic highlighter to set diagnostics.
If the semantic highlighter does not take care of setting showing the wiggly
lines for diagnostics in the editor, the model manager will do.

Change-Id: Ie69fb798dd53d60ddca1668b8f586266a0daca4b
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
2012-03-15 11:40:46 +01:00
Francois Ferrand
cbc328e2d7 CppEditor: fix indentation of auto-completed comments.
Fix indentation of auto-completed Doxygen comments, as well as auto-
leading characters from the block, to make it work with both spaces and
tabs.

Change-Id: I6c1c1665675cc25e01983e6d39b472f1b1c9683e
Reviewed-by: Leandro Melo <leandro.melo@nokia.com>
2012-03-15 06:39:29 +01:00
Erik Verbruggen
f1b2100e34 Move the ModelManagerInterface out of the CPlusPlus library.
Change-Id: Iffaa18f848a22f6961b49dff048672b194570df6
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
2012-03-14 11:46:24 +01:00
Eike Ziller
63f0c0a62f Merge remote-tracking branch 'origin/2.5'
Conflicts:
	qtcreator.pri

Change-Id: Ic24b756b41d2a13f3d696dee69553d2c3241ab95
2012-03-14 09:33:25 +01:00
Francois Ferrand
c1f3b7170d Do not add parentheses when completing dereferenced function.
When completing function name, scan text backwards to find if we are
trying to dereference the function.

Change-Id: I32cabecb651ff35d949600d9fdeb61c8e68ae98f
Reviewed-by: Erik Verbruggen <erik.verbruggen@nokia.com>
2012-03-13 11:12:45 +01:00
Flex Ferrum
4ca6c51c7f C++: Lambda formatting issues.
Fix code formatting in cases when '{' and '}' appear within expression
context (ex. lambda expression, initializer lists).

Change-Id: I42b28170a8d6d5fd08a9a1a8d8e7698219c18966
Reviewed-by: Erik Verbruggen <erik.verbruggen@nokia.com>
2012-03-12 14:38:26 +01:00
Eike Ziller
4b8df15f3d Merge remote-tracking branch 'origin/2.5'
Conflicts:
	src/plugins/remotelinux/startgdbserverdialog.cpp

Change-Id: I69597e20d5372e9baf12ac09fc20d39406683f9e
2012-03-08 07:48:55 +01:00
Robert Loehning
b41171c847 Normalized connect()s
Change-Id: Id353ab140a46e06ffc3abf667ab3b234e749e17c
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
2012-03-06 12:46:52 +01:00
Eike Ziller
9c9316b9e7 Merge remote-tracking branch 'origin/2.5' 2012-03-05 13:48:48 +01:00
Tobias Hunger
339b34a5df Add missing copyright headers
Change-Id: I71f9050a7de9c7b07bcd7d96c8e5fc64a8565fb0
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
2012-03-05 10:12:08 +01:00
Friedemann Kleint
4e83fb7953 Port Qt Creator to the new plugin system of Qt 5.
- Add Q_PLUGIN_METADATA for Qt 5, use Q_EXPORT_PLUGIN
  for Qt 4.
- Generate the Json files for Qt 5 from the pluginspec
  files by using a XSLT sheet.

Change-Id: I8653f182ae7d61615971c093df10b84fb06c2172
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-03-02 14:13:49 +01:00
Orgad Shaneh
164db0feeb qbs: Cleanup
* Removed utils, extensionsystem and aggregation dependencies
for plugins that depend on Core
* Capitalized Find and CPlusPlus

Change-Id: I505e5f46976f26da47ad778860f103b173668b1c
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-02-28 08:58:11 +01:00
Erik Verbruggen
6e6e756d01 C++: fixed source-to-project-part map calculation
When the information for a project is updated, the mapping was cleared
and only recalculated for the new project info. Thereby wiping out
the info for any previously added project.

Change-Id: Ic6999b9be07f8cb6b4638723e6c8c7d2d3ca52e7
Reviewed-by: Erik Verbruggen <erik.verbruggen@nokia.com>
2012-02-23 14:17:19 +01:00
Joerg Bornemann
d70505b005 qbs project files updated
Change-Id: Id1ca01f4910003535a32b7d3b0ad5fd3d433172a
Reviewed-by: hjk <qthjk@ovi.com>
2012-02-23 13:18:58 +01:00
Erik Verbruggen
2d262bd3b7 [C++] Added object pool handling for CompletionAssistProvider.
Change-Id: I89634989a7f360a30f7ed1bde4e67c93551ddfe4
Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
2012-02-23 10:33:50 +01:00
Erik Verbruggen
f3a3bf78c0 C++: Fixed crash.
Change-Id: Idec56cfced6e6eb2e0a78c4f242e7c81fec08692
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
2012-02-23 10:33:38 +01:00
Erik Verbruggen
368d5926ca C++: handle destructor names with template parameters.
Change-Id: I74b4fd5e043db935abc18345b303d294b71e8fc2
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@nokia.com>
2012-02-23 08:39:34 +01:00
Flex Ferrum
da2aa0df72 C++: Add support for C++11 range-based 'for' loops
Change-Id: I7eef048a7952a79f031ae3d0abba68e3c5ffbfb8
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
2012-02-21 15:27:00 +01:00
Erik Verbruggen
3123e8862b C++: killed old dead code.
Change-Id: I480470c299f49a02d2a216d3aece81a843d73ce1
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
2012-02-21 09:19:04 +01:00
Joerg Bornemann
ff92cdec43 add qbs files
Change-Id: If6bf71797ae81655d24a77e6badb86a77312af38
Reviewed-by: hjk <qthjk@ovi.com>
2012-02-20 19:18:18 +01:00
Erik Verbruggen
6fe6f5cdb1 C++: make highlighting/completion plugable.
Change-Id: I990fdf5411153041c6b4c62f31b453342d59de53
Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
2012-02-20 14:21:22 +01:00
Eike Ziller
d66acb51d0 Rename IFile->IDocument and FileManager->DocumentManager
And adapt the other API respectively.

Change-Id: I1e04e555409be09242db6890f9e013396f83aeed
Reviewed-by: Bill King <bill.king@nokia.com>
Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
2012-02-20 13:32:49 +01:00
Erik Verbruggen
3aab8beaf4 Supply c++11 flags and per-project info to c++ code model.
A manual squash/merge of the changes below, plus a couple of subsequent
code fixes.

59085aa5fbb99e2d786cd2c1a06c24a111ccb49f:
    Modify CppModel::ProjectInfo

    Adding per project node information, to pass on the correct
    defines/includes for each file, instead of aggregating them incorrectly.

    Also split up SOURCES and OBJECTIVE_SOURCES.

    Also ask the toolchain to convert the compilerflags to flags the
    codemodel understands, for now only gcc and only c++11.

    Also make the toolchain aware of the flags used to compile, so that it
    can emit the correct defines.

    Note: No header files are passed on.

74028802314cd4e75b41b46407433e07090a304d:
    GCC: Evaluate cxxflags when checking for predefined macros

ebaaa4957e4c02cc9637a998eddae1d0acd74f83:
    MSVC: Take cxxflags into account when checking for predefined macros

9bfce7e889bcf7bcc47bf880e3ea25945ca7d0d7:
    Compile fixes

Change-Id: I9de94ad038dfc5dc1987732e84b13fb4419c96f5
Reviewed-by: Erik Verbruggen <erik.verbruggen@nokia.com>
2012-02-16 15:17:17 +01:00
Erik Verbruggen
3fa55b7ab9 Removed module names from #include directives.
Getting the #include directives ready for Qt5. This includes the
new-project wizards.

Change-Id: Ia9261f1e8faec06b9285b694d2b7e9a095978d2b
Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
2012-02-15 16:24:46 +01:00
Daniel Teske
accb0040ed SessionManager::loadSession inline impl functions and rewrite
The order of actions and thus the state at which the signals are emitted
has changed. The aboutToUnloadSession comes before the actual saving
now. Also the aboutToLoadSession is after restoring values but before
restoring projects and editors.

Change-Id: I3eae66cffae970f00535d8d6e2bb11a6ca645456
Reviewed-by: hjk <qthjk@ovi.com>
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
2012-02-13 13:28:54 +01:00
Leandro Melo
70b64280ee Improve code-assist API isSortable
Now IGenericProposalModel::isSortable also takes the current prefix
as a parameter. This is particularly useful for cases like in the C++
completion: For global completions it will only sort if there's
already a content prefix - Notice, however, that the "sorting threshold"
for a maximum number of items is still kept in IGenericProposalModel::sort.

Task-number: QTCREATORBUG-6404
Change-Id: I3c2f282aa565287b8b4989930b6a27093862ef25
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
2012-02-10 14:25:42 +01:00
Erik Verbruggen
db25f9a136 C++: Added highlighting for labels.
Change-Id: I559a3112d2aa0a3c09554f8da8b7917f9aa27944
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
2012-02-09 13:32:46 +01:00
Friedemann Kleint
7caeb1d627 Fix compilation with Qt5.
- Add missing QtScript module (pulled by json in utils
- Include type definitions for Q_DECLARE_METATYPE
- Unconditionally include QtSvg in Qt5

Change-Id: If298dd98fb660a6ba701f1ba36ced2d2027ea3e8
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-02-09 12:44:40 +01:00
Friedemann Kleint
622cac50f4 Move QtConcurrent library into Utils.
It causes a conflict with the new QtConcurrent library
of Qt 5 and is quite small.

Change-Id: Ib97ab6daf8f67a88300cf03f044ba3593a4cd270
Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
2012-02-09 12:33:10 +01:00
Erik Verbruggen
dbc3332b8e C++: Moved completion/highlighting into the model manager.
This way the editor does not need to know all the details of
instantiating or maintaining classes for highlighting and/or completion,
it can just ask the model manager. The change also enables different
highlighting- or completion-engines without changes to the cppeditor.

Change-Id: I8000d9d9fe446b292defddb2295493cf77d0f14a
Reviewed-by: Leandro Melo <leandro.melo@nokia.com>
2012-02-08 14:30:14 +01:00
Eike Ziller
88d95250ef Move repeated searches to top.
Task-number: QTCREATORBUG-6907

Change-Id: I25c04185beb3729e2d11cc88d17fcd1a3b51037c
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
2012-02-07 16:13:41 +01:00
Leandro Melo
5b847a66df C++: Handle add definition on empty files
Now in the case of a matching empty file we still select a best
token so the insertion happens *at* the end of the file.

The patch also fixes line breaks after the definition to be inserted
for situations in which there's no line break yet. Example:

namespace Foo {}

namespace {
}

Another thing for correctness. Member _key from HighestValue is now
value initialized instead of default initialized.

Task-number: QTCREATORBUG-6696
Change-Id: I5c0303675429c3da5cb88825272c9611be022f6a
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
2012-01-31 16:44:38 +01:00
Daniel Teske
b8ae31e664 Remove checking for a null sessionmanager.
That can't happen.

Change-Id: I05293e96e7a716fbaf5fd03aa182c723c9858a03
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
2012-01-31 14:15:35 +01:00