Commit Graph

459 Commits

Author SHA1 Message Date
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
Erik Verbruggen
346e84d219 C++: introduce a project config file field in the projectPart.
This field is used by the generic project manager which passes the
".config" file in it. The advantage is that both the SnapshotUpdater and
the clang code model do not need to do anything smart, but can pass it
directly to the preprocessor.

Task-number: QTCREATORBUG-11390
Change-Id: I44fc7b20afd28fb59608412f2cce86af6f7e7d6b
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2014-02-27 15:58:17 +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
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
Nikolai Kosjar
746da71527 CppEditor/CppTools: Avoid triggering garbage collector on editor close in tests
Closing an editor might trigger a timer which leads to the invocation of
the garbage collector. This is unfavourable for the plugin tests since a
test function closing an editor might influence a subsequent test
function (e.g. files get removed from the global snapshot although they
were added shortly before).

Change-Id: Ia80c11f99e2437fe145dc2d983b21962539b5181
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2014-01-07 14:19:43 +01:00
Eike Ziller
e035ae6df1 Merge remote-tracking branch 'origin/3.0'
Conflicts:
	share/qtcreator/debugger/stdtypes.py
	src/plugins/qmlprofiler/qmlprofilereventsmodelproxy.cpp

Change-Id: I5d86746d58960e41e01e725ccb2a6c00890f0dfd
2013-12-18 11:02:16 +01:00
Nikolai Kosjar
a8e7b6bd38 CppEditor: Use the project part chosen with CppPreProcessorDialog
...otherwise the CppPreProcessorDialog is only semi-useful.

Change-Id: I6b80967b05e7c9a51cd78ae064a3d78170948e32
Reviewed-by: David Schulz <david.schulz@digia.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2013-12-16 10:32:26 +01:00
Erik Verbruggen
ea1a92484a C++: split defines into project-defined and toolchain-defined.
So we can ignore possibly problematic toolchain-defines, while can still
unconditionally apply project-defines.

Change-Id: I7cb96f35a963d080011fe888ef71bfc098dd33ef
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2013-12-10 11:42:41 +01:00
Nikolai Kosjar
51d91a6075 CppTools: Add revisions to AbstractEditorSupport
So far revisions for AbstractEditorSupport were not needed because until
recently we only had a single snapshot ("global snapshot"). Now, since
editor snapshots are introduced, we need to make sure to update the
corresponding documents in these snapshots, too. To do this efficiently,
a revision is introduced for AbstractEditorSupport.

Task-number: QTCREATORBUG-10894

Change-Id: Ibad1dbbafb7c721d1328959c1e903345fe465326
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2013-11-25 17:40:30 +01:00
Nikolai Kosjar
36ce1dbb84 Designer/CppTools: Fix flaky test_gotoslot_withoutProject
The document was not always updated in time.

Change-Id: Iac89985d39a8784e3cbf63dfd42b1c5150775068
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
2013-11-14 08:34:45 +01:00
Erik Verbruggen
566be0995d C++: Release more documents.
- fix memory leak in find-usages
- do not retain snapshot in search history
- when an editor is invisible for more than 2 minutes, release the
  backing snapshot

Retaining snapshots will retain their documents, and if done for too
long, the memory consumption might grow. This is especially the case
when switching to a different kit (Qt version): in that case, the new
versions of headers will be indexed, while the old ones stay around.

Task-number: QTCREATORBUG-5583
Task-number: QTCREATORBUG-7645
Task-number: QTCREATORBUG-9842

Change-Id: I045eda1565e0a3fa702baeffaab9c12662f90289
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2013-11-12 09:24:13 +01: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
Nikolai Kosjar
90130f4596 CppTools: Tests: Fix crash in test_modelmanager_gc_if_last_cppeditor_closed
The project that was referenced at cppeditor.cpp:711 was already
deleted. CppModelManager::m_fileToProjectParts contained outdated
information. Now it is updated if a project is closed.

Exposed by commit d411c07.

Change-Id: I6fee93a02c72a045dd44a05723ab39a1eeec616e
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2013-10-09 15:02:45 +02:00
Erik Verbruggen
ba2d7a4fa7 C++: Only parse with appropriate defines for open editors.
If two files from different (sub-)projects include the same header file,
and the defined macros differ for both files, the header file will be
parsed with only the appropriate macros for the including file.

Task-number: QTCREATORBUG-9802
Task-number: QTCREATORBUG-1249

Change-Id: I560490afa287b3bb1e863bce1bb4f57af36ad56e
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2013-10-01 10:33:51 +02:00
Erik Verbruggen
c9f5a14bdd C++: add code-model settings to choose one by mime-type.
The model-manager now supports multiple code models for semantic
highlighting and code completion, and will choose one based on the
mime-type of the editor.

The settings page is currently disabled. It will get enabled when a
second plug-in lands that has a ModelManagerSupport class.

Change-Id: I10023f52322ed6860397da15dba1c231e80e6517
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2013-09-13 14:37:48 +02:00
Erik Verbruggen
f7c68f6baf C++: change working-copy to work on UTF-8 encoded QByteArrays.
These not only take less space than UTF-16 encoded QStrings, but due to
the caching in the CppEditorSupport also take less time to build.

This patch also fixes a number of possible encoding issues, where files
and constant strings were (falsely) assumed to be UTF-8.

Change-Id: Ib6f91c9a94ebed5b5dfbd4eb2998825c62c72784
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
Reviewed-by: hjk <hjk121@nokiamail.com>
2013-09-11 09:43:14 +02:00
Erik Verbruggen
3a5d3a2fe9 C++: unify highlighting/code-completion support "factories".
Both semantic highlighting and code-completion go hand-in-hand, so now
the ModelManagerSupport class acts as a "factory" for the model manager.
Depending on the mime-type of the document in the editor, the model
manager will return the appropriate highlighter or code-completion
engine. If none is registered, the built-in fall-back is used.

Change-Id: I3e5dbb0e3b58e077dd5eda9aecb2ce5d448ac0b8
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2013-09-10 11:45:38 +02:00
Erik Verbruggen
87a3aac18f C++: add fallback project part querying
When a file is not part of any other project part, this project part can
be used to get at least some compiler flags, defines, etc. to use. This
can happen when either a file outside a project is opened, or when the
project description is incomplete.

Change-Id: I5d595fae7195e8b61dbad14368b6cae9eb15c21b
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2013-09-10 07:36:25 +02:00
Erik Verbruggen
b4a1bd415f C++: clean-up CppCompletionAssist.
This is step 1 of 2 for merging the various provider factories into a
single class. Merging has the advantage that selecting based on editor
(content) mime-type only has to select one class, instead of re-doing
the selection for each class separately.

Change-Id: I11f815151bd4769ae6028b636793d6a80d02e202
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2013-09-09 11:59:14 +02:00
Erik Verbruggen
7516ef4969 TextEditor: get CompletionAssistProvider from editor.
And not from the global object pool. This way, the editors that have
different highlighters for various language dialects, or editors that
support multiple languages in a single editor, can decide themselves on
what CompletionAssistProvider to provide.

Change-Id: Ieebc4a8e7b3de6470fdb8103035aa3b8b2ba6598
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2013-09-09 10:15:55 +02:00
hjk
aadb6f16af SessionManager: Apply 'static' pattern
Change-Id: I370f72fcf7a24216ee189979ce6b5c8bfc5f4140
Reviewed-by: David Schulz <david.schulz@digia.com>
2013-09-05 12:28:12 +02:00
hjk
98917598d3 ProjectManager: Use Core::Id for progress types
Change-Id: I72993fda50ad70ad2d7c2f449923ac6e34b9e737
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
2013-09-04 14:59:06 +02:00
hjk
df36184371 Core: Static pattern for ProgressManager, clean up all users
Change-Id: I4af8793ca69a3af9e99baeb7c31dad3864266f91
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
2013-09-02 12:41:47 +02:00
Erik Verbruggen
073e5d6632 C++: optionally let the highlighter handle ifdefed-out blocks.
Change-Id: I38cc0e55348cac0245d2ab8f3e39c68de76e3e6d
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2013-08-19 13:01:07 +02:00
Nikolai Kosjar
8ea14767af CppTools: Rework handling of ProjectInfo changes
(a) The code model manager figures out by itself which files were added
    or removed from the project.

    If this was done successfully, check also the timestamp of the
    common files and reindex if necessary.

(b) A full reindexing is only triggered if the project configuration
    changes (defines, includes, framework paths).

(c) If project files were removed, the garbage collector is called.

Task-number: QTCREATORBUG-9730
Change-Id: Ib855614b070880576233a3525813617c967a72f3
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
2013-08-13 14:13:33 +02:00
Nikolai Kosjar
2665a1249b CppTools: Do not garbage collect files in the working copy
...except the configuration file if no projects are open. For this case
there is no need to keep the configuration file around.

Task-number: QTCREATORBUG-9829

Change-Id: I51b01b30c17cbc1ced491ef2c47c338dae6ed983
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2013-08-08 12:12:31 +02:00
Nikolai Kosjar
7583039b87 CppTools: Do not call GC() more than necessary
Currently GC() is invoked if
   - 5 CppEditors were closed or the last CppEditor was closed
   - a project is about to be removed
   - a session is about to be unloaded

Thus, for the following use cases, too much GC() calls (can) happen:
    - File > Close All
    - Close All Projects and Editors
    - Changing the session

Fixed by introducing a timer.

Change-Id: I9c984d9de735fc8c6ee77a518e9fb5b63dba5881
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2013-08-08 12:12:08 +02:00
Tobias Hunger
5422b2c4da Introduce Project::projectFilePath()
Use it instead of retrieving this information from the document.

Change-Id: I809fcb2daf59021cf503c371a5d40d75d7448796
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
2013-08-01 11:42:41 +02:00
Nikolai Kosjar
fdaddec7d1 CppTools: Clean up CppModelManager(Interface)
* Const correctness
* Better variable names
* Sort order of includes and forward declarations
* Comment fixes
* Cosmetic/Whitespace changes

Change-Id: Ieb137266ac7eddedb00c37f8b2cc8677d67e4bdd
Reviewed-by: David Schulz <david.schulz@digia.com>
2013-07-31 14:34:08 +02:00
Oswald Buddenhagen
6896546ba5 Merge remote-tracking branch 'origin/2.8'
Conflicts:
	src/plugins/cpptools/cppmodelmanager.cpp

Change-Id: I0e69dfad951eb81d8008f5ca05e8fb6999ae2c8a
2013-07-25 13:18:31 +02:00
Nikolai Kosjar
e2ce17ef00 CppTools: Fix "! condition" coding style
Change-Id: Ic7e634e4249fb64edbc2daceb65ec8e9b5f0f8b9
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Aurindam Jana <aurindam.jana@digia.com>
2013-07-25 13:11:34 +02:00
Nikolai Kosjar
072b7c5718 CppTools: Check if project has changed before reparsing
This introduces an API change for the project managers. Those are not
expected to call updateSourceFiles() anymore.

Task-number: QTCREATORBUG-9581
Change-Id: I77befd29fb851c9acf87204d571da00183c9cd05
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2013-07-22 08:33:52 +02:00
Nikolai Kosjar
c84e3a27d6 CppTools: Garbage collect if the last CppEditor is closed
Task-number: QTCREATORBUG-9828

Change-Id: Ie0ef9757cedb772702e49542b58d5b589506aa9e
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2013-07-17 14:54:10 +02:00
Nikolai Kosjar
bc4fa63f84 CppTools: Move GC() call from CppEditorWidget to CppModelManager
There is no need to have that logic in CppEditorWidget. The
CppModelManager knows how many editors are open and can therefore call
GC() by itself.

Change-Id: I2ed4051ad7b8c87615014d73e29291027d49d2ab
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2013-07-17 14:54:01 +02:00
Eike Ziller
dd43d9908f Rename IDocument::fileName --> filePath
That is what it actually is, wrt how Qt API calls it.

Change-Id: Ied02055debf6aad75556b0d9d22e8ba2f72be555
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2013-07-09 13:51:42 +02:00
Erik Verbruggen
afa66ab9c7 C++: fix potential deadlock when closing an editor
When the editor is closed, the CppEditorSupport waits for the
highlighting and semantic info futures to finish. These futures might
access the CppEditorSupport through the CppModelManager, causing a
deadlock on the m_editorSupportMutex.

Change-Id: Ifeb3864ed3bc2666d83607ef50d7bfee8f3d118f
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2013-07-02 15:27:54 +02:00
Nikolai Kosjar
1fad00f999 CppTools: Fix snapshot in case another project is opened
When a second project was opened the snapshot was reset. That resulted
in all kinds of problems since from then on the code model effectively
was not aware of the files of the first project.

The regression was introduced by commit a0d6df7b.

Change-Id: I1ccc9de68177205b49a4ba8ead2bc8abe4592b32
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
2013-06-28 17:54:53 +02:00
Nikolai Kosjar
26fbefb26c CppTools: Allow to force a "Parsing" notification
Task-number: QTCREATORBUG-9597

Change-Id: I726a818c7d4af35dcb4863f74b08cd639a189bdd
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
2013-06-24 13:10:51 +02:00
Leena Miettinen
41411165ba Doc: use standard wording in \brief commands
QDoc does some magic with the \class and \namespaces
and \brief commands, so the following wording must be used:
"The xxx class yyy ..."

Change-Id: Id231f30e8464898b776888d5423523de404aae34
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2013-06-20 11:22:47 +02:00
Erik Verbruggen
18dcac7ad0 C++: fix encoding/conversion of built-in macros
Task-number: QTCREATORBUG-9404

Change-Id: I732b729e64b065b4ac75c547d9370cbc64918a31
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2013-06-17 08:14:39 +02:00
Erik Verbruggen
10725c086b C++: fix Q_CREATOR_RUN macro handling
Moved it from the handleIfDefDirective to the pre-defined macros, so
that #if defined() can also see it.

Task-number: QTCREATORBUG-9322
Change-Id: Icbecad5c885dd2374b559969c99631c3ddc73844
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2013-06-03 15:41:54 +02:00
Erik Verbruggen
feff33827c C++: fix crash when failing to open non-existing file.
Change-Id: Ie7bd3b36139ab7fac1186cefa7222dff7277eb53
Reviewed-by: hjk <hjk121@nokiamail.com>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2013-05-24 14:17:47 +02:00
Erik Verbruggen
09ea0d235a C++: moved the CppPreprocessor into its own file.
Change-Id: I399d667a1fccb376fadbd6ab8fbba243e86d8f4b
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2013-04-26 13:56:08 +02:00
Erik Verbruggen
ecacaab7a4 C++: model-manager clean-ups.
Change-Id: I59fdb898e270af0fcc18e79ae922e119504ef10e
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2013-04-26 13:00:43 +02:00
Erik Verbruggen
0c27b27658 C++ Detach the CppEditor from code-model internals.
- Moved document update handling into CppTools.
- Moved semantic info calculation into CppTools.
- Moved semantic highlighting into CppTools.

Change-Id: I253861bf074a64b1f657f7a4a8e6583871b5285f
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2013-04-26 12:47:06 +02:00
Nikolai Kosjar
52825a91f9 C++: Preprocessor: Do not add configurationFileName() to the seen files
After processing configurationFileName() the first time, it was added to
the already seen files (m_included). Thus, on parsing further files, it
was ignored and with that all the project defines.

Task-number: QTCREATORBUG-9107
Change-Id: Ia4817dfa3b30ed27d142f7f3eeb6f099d0653441
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2013-04-26 09:55:32 +02:00
Erik Verbruggen
cd581ecd0b C++: do not run GC when exiting.
This operation is quite costly if a lot of files are involved, and in
case of exiting Creator, it's also useless.

Change-Id: I97d178d47a3a2f6b214f7ebc45c871edd26b8286
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2013-04-22 10:08:55 +02:00
hjk
fb72d5324e C++: Also cache result of misses in resolveFile()
Change-Id: Ib501bbe16548b194ff5028a1b3ab74c5f0e3230d
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2013-04-16 12:36:00 +02:00
Erik Verbruggen
a0d6df7bd8 C++: also refresh files not in the project when project changes.
System headers and other file which are not explicitly mentioned in the
project must be reparsed when the project changes.

Task-number: QTCREATORBUG-9056
Change-Id: I32f1206d241a078a4d9b15fac5813f365a1ba303
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2013-04-16 11:56:18 +02:00