Commit Graph

72 Commits

Author SHA1 Message Date
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
23777da0e8 C++: Add dumpers for common datatypes to simplify debugging.
Change-Id: I03f907dd0e8d9d63f0dfd38499c98296b5c7871a
Reviewed-by: Christian Kamm <christian.d.kamm@nokia.com>
2012-07-23 07:19:17 +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
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
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
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
hjk
2931a499e6 Long live the king!
Change-Id: I2b72b34c0cfeafc8bdbaf49b83ff723544f2b6e2
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
2012-01-26 19:55:36 +01:00
Leandro Melo
466ea4842c C++: Improve file accuracy when finding symbols
This patch introduces a priority-based mechanism when searching for certains
symbols in the snapshot. The priority corresponds to how similar the file path
from the "reference" symbol is to the file path from the "candidate" symbol.
This solves a variety of issues when matching "equivalent" symbols but that
are in another file/project, such as when following a function declaration,
a forward class declaration, or adding a definition through a quickfix.

There's now a symbol finder which will compute the "best" search order and cache
the most recent results. A consequence is that following symbols in some cases
is slower, but not apparently significatly.

Note: The "find" functions were moved from the Snapshot to the new SymbolFinder
class.

Task-number: QTCREATORBUG-6697
Task-number: QTCREATORBUG-6792

Change-Id: Ia518f014275fec1f4d0cb3224bd4e06a9df6d557
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
2012-01-23 11:34:44 +01:00
Leandro Melo
c287d90604 C++: Rename source/setSource to utf8Source/setUtf8Source
Continuinng a previous commit... This is in order to make
the interface clearer.

Change-Id: Ic1b05217f878578bc84a064927507b75981c47d6
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
2012-01-13 11:22:28 +01:00
hjk
31600758de all: s/info@qt.nokia.com/qt-info@nokia.com/
Change-Id: If18afb5d4665924e7d9250dccbc60a65e6daa75e
Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
2011-11-03 10:33:19 +01:00
Christian Kamm
10a956a8f7 QmlJS: Find setContextProperty calls in C++ and expose to QML.
Task-number: QTCREATORBUG-3199

Change-Id: I591490ceafadc0f5a07c63ec063f1bdfa7055f47
Reviewed-on: http://codereview.qt-project.org/4074
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com>
2011-09-08 12:34:22 +02:00
Leandro Melo
f235f2594b C++: Export DiagnosticMessage
This is now necessary due to the recent change
that added the non-inline operator==.

Change-Id: I62255ddeb09f1e312a802db9733575e73ea56478
Reviewed-on: http://codereview.qt.nokia.com/3928
Reviewed-by: Christian Kamm <christian.d.kamm@nokia.com>
2011-08-31 11:52:57 +02:00
Christian Kamm
9f7a2194f7 QmlJS: Fix infinite loop when scanning for exported C++ types.
Setting extra diagnostics would call updateDocument which would in turn
trigger another scan.

Change-Id: I3810a380cdf716a12767d94ff82dc30f8ae3954d
Reviewed-on: http://codereview.qt.nokia.com/3917
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
Reviewed-by: Leandro T. C. Melo <leandro.melo@nokia.com>
2011-08-31 10:53:21 +02:00
Christian Kamm
51ea52971f C++: Always remove NumericLiterals when removing the AST.
Contrary to StringLiterals, keeping them around is unnecessary.

Change-Id: Idc1967c125e1373e69ce4c7640328d323a84ec14
Reviewed-on: http://codereview.qt.nokia.com/3395
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
2011-08-25 13:19:32 +02:00
Christian Kamm
27d0830698 QmlJS: Move the exported-C++-type detection out of C++ code.
It now lives in qmljstools/qmljsfindexportedcpptypes, all in one place.

Also ensures that the source code is available when a file is being
scanned for QML exports. This will enable checking comments for
annotations about the URI a plugin is usually imported as.

Change-Id: I1da36d0678e0a8d34b171dbe0f6b5690d89eb18b
Reviewed-on: http://codereview.qt.nokia.com/3392
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com>
2011-08-24 12:13:41 +02:00
Christian Kamm
8f14bc0ea2 C++: Synchronize function decl/def refactoring.
When editing a function declaration or definition the code model
may realize the same changes have to be applied somewhere else. A
refactoring marker will pop up that can be clicked to perform the
changes. Alternatively, press enter to apply.

Change-Id: I2299a2ecfb6a8f87d4853fc7cfa99486f890a1d3
Reviewed-on: http://codereview.qt.nokia.com/2909
Reviewed-by: Leandro T. C. Melo <leandro.melo@nokia.com>
2011-08-16 11:13:12 +02:00
Tobias Hunger
aa2acec14c Fix/add copyright headers
Change-Id: I8b73d583be1ee7183f4074bce49d5390e38631a2
2011-05-06 15:17:05 +02:00
hjk
8397663964 Update license. 2011-04-13 11:49:28 +02:00
hjk
57eae3191e s:// end of namespace :// namespace :g for consistency
We use the latter style everywhere else to signify the end of a namespace block.
2011-02-04 12:45:32 +01:00
con
d1023c7614 It's 2011 now.
Reviewed-by: hjk
2011-01-12 09:46:24 +01:00
Christian Kamm
0194da7300 Qml-C++: Find C++ qmlRegisterType calls and populate QML code model.
Reviewed-by: Erik Verbruggen
2011-01-04 15:58:22 +01:00
con
04e32b0049 License headers. 2010-12-17 16:03:42 +01:00
Roberto Raggi
644544185f Restore the old behaviour when switching between function declaration/definition symbols.
That is, we don't look at the column position anymore when searching
the function under cursor.
2010-08-17 14:30:11 +02:00
Roberto Raggi
e5ecb6b072 Nicer implementation of Document::lastVisibleSymbolAt(). 2010-08-17 13:42:30 +02:00
Roberto Raggi
354b9712e4 Merged ScopedSymbol and Scope. 2010-08-11 15:25:18 +02:00
Christian Kamm
e1a0f5abef C++: Make 'follow symbol' work with forward declared classes.
If it encounters a forward declaration, it tries to find the class
declaration globally now.

Task-number: QTCREATORBUG-20
2010-06-16 15:37:39 +02:00
Roberto Raggi
a31de2c37a Fixed header protection. 2010-05-28 17:17:11 +02:00
Roberto Raggi
0ce09d9d87 Added an optinal member `length' to Document::DiagnosticMessage. 2010-05-25 17:15:21 +02:00
Roberto Raggi
18490596f9 Renamed Document::findSymbolAt(). 2010-05-17 13:01:56 +02:00
Roberto Raggi
60f76c96e8 Improved LookupItem and get rid of some deprecated code. 2010-05-14 13:55:21 +02:00
Roberto Raggi
c282da7d1e Introduced Snapshot::findMatchingDefinition(). 2010-05-11 14:15:07 +02:00
Roberto Raggi
7eae51507c Removed deprecated method Snapshot::globalNamespaceBinding(). 2010-05-11 14:15:06 +02:00
Roberto Raggi
61a504c427 Ensure that the memory pool can be reused after a rewind and get rid of the segmented array. 2010-03-18 15:23:13 +01:00
Erik Verbruggen
1cc5e1fe01 Put the include depenency table into a separate class, and cache it when possible. 2010-03-17 14:20:17 +01:00
hjk
9595504bda Long live the king! 2010-03-05 11:28:13 +01:00
Christian Kamm
c3cc7cf4d8 Enhance data stored for macros and macro uses.
In preparation for finding macro uses.

* Macro: add offset and length
* MacroUse: add line
* Document: add convenience functions for finding a macro definition, use
  or undefined use at a given location.

Reviewed-by: Erik Verbruggen
2009-12-21 14:57:05 +01:00
Roberto Raggi
51de95c497 Use the text editor revision to ignore outdated parse results. 2009-12-15 15:52:55 +01:00
Roberto Raggi
60caec48d1 Store the documents in an hash. 2009-12-07 11:12:55 +01:00
Roberto Raggi
14376c3c32 Initial work on the new CPlusPlus::Snapshot.
Encapsulate the details.
2009-12-07 10:54:27 +01:00
Roberto Raggi
8741494f41 Rename dependsOn() in filesDepedingOn() and introduced Snapshot::dependencyTable(). 2009-12-02 17:07:10 +01:00
Friedemann Kleint
d2bd092b47 Code model: Fix Windows issues (duplicate matches).
Ensure the code model receives file names with clean paths ('/')
and fix paths in the relevant places of the code model. Pass on clean
paths from Cpp reference find and display them correctly in the search
window tooltip.

Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
2009-11-09 13:53:28 +01:00
Roberto Raggi
eaa2c10a25 Introduced CppTools::CppModelManagerInterface::updateModifiedFiles().
updateModifiedFiles ckecks the timestamp and reparses all the modified files in the current snapshot.
2009-11-05 12:34:02 +01:00
Roberto Raggi
f829ef899c Store in the document's macroUsages only the top-level macro expansions. 2009-10-15 16:25:10 +02:00
Christian Kamm
22ed0255b9 Track more macro uses.
In particular macros that are only checked for definition or are
expanded during the evaluation of an #if or #elif directive are now also
added to the list available through Document::macroUses().

The names of undefined macros that are interesting (because they're used
in an #ifdef or a defined(...)) are now available through
Document::undefinedMacroUses().

Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
2009-09-25 16:08:01 +02:00
hjk
93cbef8724 long live the king 2009-08-14 09:30:56 +02:00
Roberto Raggi
1e7b406327 Added Snapshot::dependsOn().
Snapshot::dependsOn(fn) returns the files in the snapshot that depends on fn.
2009-07-29 10:18:07 +02:00
Roberto Raggi
37a146d05c Introduced revisions in CPlusPlus::Document.
Reviewed by Thorbjørn Lindeijer
2009-07-14 14:24:02 +02:00
Roberto Raggi
fd4dbd7446 Introduced Snapshot::simplified(doc) 2009-07-10 12:42:55 +02:00
Roberto Raggi
fd8cd69a47 Introduced Document::CheckMode. 2009-06-26 09:11:14 +02:00
Jason McDonald
884b7af769 Update license headers and sales contact details.
Reviewed-by: Trust Me
2009-06-17 00:01:27 +10:00