Commit Graph

198 Commits

Author SHA1 Message Date
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
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
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
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
hjk
4a21f0c3c8 Use new static ICore interface.
Change-Id: I9b690d9b150c8d162b15370f9f8986267c9128f1
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
2012-01-24 18:48:47 +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
Erik Verbruggen
7270633f86 C++: removed pre-defined macros that should come from windows.h
Task-number: QTCREATORBUG-5734
Change-Id: Ie4aa437616955fd65fcc6adbfc0e9f115caf7e1c
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2011-10-26 15:28:07 +02:00
Thorbjørn Lindeijer
c2f31f16dc Added support for Microsoft-specific inline keywords
__inline is equivalent to inline.
__forceinline is used to override the cost/benefit analysis.

Change-Id: Ifc7c94c1798f98c553ffa979a722ede9df11b3f0
Merge-request: 2206
Reviewed-by: Christian Kamm <christian.d.kamm@nokia.com>
Reviewed-on: http://codereview.qt-project.org/4416
Reviewed-by: Leandro T. C. Melo <leandro.melo@nokia.com>
2011-09-08 12:02:28 +02:00
Leandro Melo
5d93161248 C++: Add __try, __except, and __finally to configuration
This is not really a direct mapping to the Microsoft specifc
ones, but I guess defining such macros is an acceptable solution.

Change-Id: I17a9414364ef664f2e8afa7ececc6a87f663049e
Reviewed-on: http://codereview.qt.nokia.com/4277
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@nokia.com>
2011-09-06 17:30:58 +02:00
Leandro Melo
b237464045 C++: Normalize line ending for preprocessing
There is logic in the preprocessor that assumes a normalized line
ending. Other patches have already fixed the issue in other parts.

Change-Id: Iac262da361b6528cc9466a6c87e83da95af9ea04
Reviewed-on: http://codereview.qt.nokia.com/4252
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Christian Kamm <christian.d.kamm@nokia.com>
2011-09-06 13:58:03 +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
94a00259ac C++/QmlJS: Warnings if C++ based QML type detection fails.
Change-Id: I1e206e09c4068cc541978ee148f9ed8c4138c249
Reviewed-on: http://codereview.qt.nokia.com/3579
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com>
2011-08-30 12:03:34 +02:00
Christian Kamm
6f3dc3198c C++ editor: Prefer to use extra selections to find diagnostics.
Change-Id: I5f1c6e29c8386018cfd4d45d8ee63fc3e24311f6
Reviewed-on: http://codereview.qt.nokia.com/3484
Reviewed-by: Leandro T. C. Melo <leandro.melo@nokia.com>
2011-08-25 14:38:08 +02:00
Christian Kamm
93e367ed0c C++: Don't strip comments from preprocessed source code.
Change-Id: I3a4817d36b9c724abca504c42914a73f97ab34c7
Reviewed-on: http://codereview.qt.nokia.com/3480
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
2011-08-25 13:20:09 +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
Erik Verbruggen
7e43490f99 Emit a signal when parsing is finished after updating source files.
Change-Id: I8a8878c420c0f8d24db16d606aace42519ac3047
Reviewed-on: http://codereview.qt.nokia.com/1151
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Bill King <bill.king@nokia.com>
2011-07-05 16:10:06 +02:00
Christian Kamm
cf7663b2de QmlJS: Read the 'revision' property generated by qmldump.
Change-Id: Ia31b1845b1e1e5aabc347dc115e580c72e36f4e3
Reviewed-on: http://codereview.qt.nokia.com/200
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
2011-05-30 09:31:37 +02:00
Leandro Melo
ab40e9c78e C++ editor: Remove scanning/caching of includes
With the completion now in a separate thread this should
no longer be necessary.

Reviewed-by: Roberto Raggi
2011-05-18 12:35:53 +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
f576ad9f2c texteditor: merge ITextEditable into ITextEditor
rename BastTextEditor->BaseTextEditorWidget, BaseTextEditorEditable->BaseTextEditor
rename BaseTextEditor{,Widget} subclasses
rename editableInterface->editorInterface
rename createEditableInterface->createEditor
minor cleanups after renamings
2011-02-22 11:23:53 +01:00
Christian Kamm
187ae1e94a QmlJS: Rework FakeMetaObjects to no longer contain pointers.
Having a duplicate prototype chain - once in FakeMetaObjects and once
in QmlObjectValues was unnecessary. Now FMOs don't contain references
which may allow other simplifications.
2011-02-10 17:04:22 +01:00
Friedemann Kleint
edb4893547 Header cleanup in src, specify module name. 2011-01-24 12:29:48 +01:00
con
a444cdc7aa Limit depth of include scanning to avoid performance problems.
Reviewed-by: Thorbjørn Lindeijer
2011-01-12 10:19:48 +01:00
con
d1023c7614 It's 2011 now.
Reviewed-by: hjk
2011-01-12 09:46:24 +01:00
Christian Kamm
283a3d32cd Qml/C++: Fix performance problem with type extraction.
By moving the offending code into a background thread.

Reviewed-by: Erik Verbruggen
2011-01-06 15:02:06 +01:00
Christian Kamm
ab642bc820 QmlJS: Add refcounting to FakeMetaObjects.
Previously they were leaked when a qmldump or the C++ exported QML
type list updated.

Just deleting the previous FakeMetaObjects is not an option, as they
might still be used in a QmlObjectValue owned by an Engine.

Reviewed-by: Erik Verbruggen
2011-01-06 15:01:09 +01:00
Christian Kamm
12f2a0fbda Qml/C++: Disable qmlRegisterType exposing until performance is better. 2011-01-05 10:29:46 +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
Christian Kamm
5f50a6ae34 C++: Move the ModelManagerInterface from CppTools to CPlusPlus. 2011-01-04 15:58:21 +01:00
con
04e32b0049 License headers. 2010-12-17 16:03:42 +01:00
Alessandro Portale
493710c2ac Do not scan "/" for include files
The scanning phase was in some cases insanely long.
Reason was that Creator feeds wrong paths to the
CppModelManager, for example "/".

The scanning phase did what it was told to: scan that whole
Harddrive.

This patch makes sure that the scanning is not done for "/"

Done-With: Roberto
2010-10-03 09:28:03 +02:00
Alessandro Portale
b9d3c1f54a No Samba while including files
(The other Samba is meant. The slow one, not the nice one.)

Creator manages to feed the CppModelManager with all kinds of
wrong include paths. That is usually not a big issue as long
as that path is not a simple "/".

CppManager appended a separator to all incoming include paths.
And when the above "/" was passed in, we had (on my machine)
7 seconds of Samba Network lookup, multiple times during a
parse. And the sad thing was that my dear colleagues in the
Intranet did not even have the searched-for header files on
their shared folders.

This patch makes sure that a separator is only appended if
the path does not already end with one.

The real core of the issue (wrong include paths from Creator)
still needs to be fixed.

Done-with: Roberto Raggi
2010-10-03 09:23:48 +02:00
Roberto Raggi
a340cd118e Get rid of the numeric literals. 2010-09-02 12:51:01 +02:00
Roberto Raggi
0540aa362d Get rid of the old Semantic pass. 2010-08-13 16:55:43 +02:00
ck
46f537e56a Quickfix: Convert underscore notation to camel case.
Reviewed-by: Roberto Raggi
2010-07-20 11:07:14 +02:00
Roberto Raggi
84ebb1048d Moved CheckUndefinedSymbols to the cpptools plug-in. 2010-07-05 17:35:54 +02:00
Erik Verbruggen
e3e8b1a5c0 Removed the TokenCache. 2010-07-02 11:18:51 +02:00
hjk
2f5f358ff4 Core::Context: compile hot fix for Windows. 2010-06-25 17:38:25 +02:00
Erik Verbruggen
e42ca194c5 Introduced token caching to prevent repetetive tokenizing.
Also removed TokenUnderCursor as it's functionality is in the token cache.

Reviewed-by: ckamm
2010-06-14 10:10:05 +02:00
Erik Verbruggen
424b9724d6 Revert "Introduced a token cache for the C++ editor."
This reverts commit c2393df023.
2010-06-04 12:37:26 +02:00
Erik Verbruggen
c2393df023 Introduced a token cache for the C++ editor.
This should speed things up a bit, because before, the line was tokenized at
least 3 times.
2010-06-04 09:36:05 +02:00
Roberto Raggi
1c078ec2a3 Ensure we keep the context around for as long as it is needed. 2010-05-31 12:37:15 +02:00
Roberto Raggi
653ca110fe Removed DeprecatedLookupContext. 2010-05-26 15:56:12 +02:00
Roberto Raggi
405353ab23 Removed the CppBindings. 2010-05-25 17:15:23 +02:00
Roberto Raggi
c5d110d6a3 Don't check for undefined symbols in CppModelManager. 2010-05-25 17:15:21 +02:00