Commit Graph

115 Commits

Author SHA1 Message Date
Nikolai Kosjar
93e82d731e CppEditor: Move CppEditorOutline to CppTools
Change-Id: I75768f548f8f914e76fbdeaf3c318c207782fe1b
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
2015-01-26 18:15:29 +01:00
Nikolai Kosjar
df1bbb07d1 CppTools: Extract base class CppCompletionAssistProcessor
As as side effect, this also brings some more pragma completions for the
builtin-in completion engine, e.g. "pragma once" or "pragma omp atomic".

Change-Id: If3ef22076c331c653b78a87cfff836c1da38c8fb
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
2015-01-21 12:19:12 +01:00
Eike Ziller
bae5782166 Add locator filter for all included files.
Collects all included files from any file of any project or
that is open in an editor. It has the same shortcut as the
files from any project filter and is also enabled by default.

Task-number: QTCREATORBUG-280
Change-Id: I7cd89ee68d2f8ec4e0ea03de0c11671f489c47dc
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-01-12 15:06:20 +01:00
Christian Kandeler
9d677e3302 qbs build: Remove unneeded import statements.
The respective items are available without it.

Change-Id: Idc840cf08e7bec84f561c096afe8de25b1fb8468
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2014-11-10 15:45:14 +01:00
hjk
b26a17f30d CppTools: Change CppModelManager implementation pattern
Replace the CppModelManagerInterface/derived CppModelManager
combo by a more common CppModelManager/CppModelManagerPrivate
pimpl pattern.

Change-Id: Ia4582845ed94d5ef60b8571bab9b2260c6290287
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2014-09-19 13:17:55 +02:00
Tobias Hunger
57cc272770 CppTools: Add some methods to the JsExpander.
Make some C++ related methods available to the JsExpander. These
are concerned with namespace handling, etc.

Change-Id: I2fc3807cf421b817bb103b727606a78aee290652
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2014-09-18 14:38:30 +02:00
Nikolai Kosjar
89bd4ee3c4 C++: Base parsing on editor document instead of widget
This mainly takes CppEditorSupport apart.

* Parsing is now invoked by CPPEditorDocument itself by listening to
  QTextDocument::contentsChanged().

* Upon construction and destruction CPPEditorDocument creates and
  deletes an EditorDocumentHandle for (un)registration in the model
  manager. This handle provides everything to generate the working copy
  and to access the editor document processor.

* A CPPEditorDocument owns a BaseEditorDocumentProcessor instance that
  controls parsing, semantic info recalculation and the semantic
  highlighting for the document. This is more or less what is left from
  CppEditorSupport and can be considered as the backend of a
  CPPEditorDocument. CPPEditorDocument itself is quite small.

    * BuiltinEditorDocumentProcessor and ClangEditorDocumentProcessor
      derive from BaseEditorDocumentProcessor and implement the gaps.

    * Since the semantic info calculation was bound to the widget, it
      also calculated the local uses, which depend on the cursor
      position. This calculation got moved into the extracted class
      UseSeletionsUpdater in the cppeditor plugin, which is run once the
      cursor position changes or the semantic info document is updated.

    * Some more logic got extracted:
	- SemanticInfoUpdater (logic was in CppEditorSupport)
	- SemanticHighlighter (logic was in CppEditorSupport)

    * The *Parser and *Processor classes can be easily accessed by the
      static function get().

* CppHighlightingSupport is gone since it turned out to be useless.

* The editor dependency in CompletionAssistProviders is gone since we
  actually only need the file path now.

Change-Id: I49d3a7bd138c5ed9620123e34480772535156508
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2014-08-25 13:06:01 +02:00
Nikolai Kosjar
7d35212f60 CppTools: Rename SnapshotUpdater to BuiltinEditorDocumentParser
Change-Id: I554b5e9e3f1ef7c167fa45b5cd0c230fdf63073b
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2014-08-20 11:12:48 +02:00
Nikolai Kosjar
27e343b970 CppTools: Extract BaseEditorDocumentParser out of SnapshotUpdater
Change-Id: If89e81eec6d600d3d39cc09203cf434d0768c1b4
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2014-08-20 10:29:21 +02:00
Nikolai Kosjar
6b5298faf9 CppTools: Move Project{Part,Info} to new cppprojects.{h,cpp}
Change-Id: Ieff216017b9da1e6a12121688ea9572bdd81fd9b
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2014-08-20 10:28:35 +02:00
Nikolai Kosjar
b8a6a4dd4e CppTools: Move WorkingCopy to new cppworkingcopy.{h,cpp}
Change-Id: I447acf28849bffb52c1e6b6eafdde221ec0b179e
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2014-08-20 10:26:47 +02:00
Nikolai Kosjar
995d1f777f C++: Add basic LocalSymbols test
Change-Id: I199e912203f329ec9b8bed2eb105e4a56f729e7d
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2014-07-04 12:35:05 +02:00
Erik Verbruggen
17febac88b C++: Rename ModelItemInfo to IndexInfo.
And move it into its own header and source files.

Change-Id: I37401badd819e028e1d767425759dc0ff27afe31
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2014-06-16 12:08:12 +02:00
Nikolai Kosjar
ec97d967e6 CppTools: Rename CppPreprocessor to CppSourceProcessor
...since it does quite a bit more than only preprocessing, as the name
suggests. We use that class to process source files in general. The
output is not a preprocessed source, but a set of CPlusPlus::Documents
with symbols.

Change-Id: I787d0f22f9f042ddf0c99e8c2f0bdb9aa7001735
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2014-06-04 16:28:35 +02:00
Alessandro Portale
6facb4391a CppTools: Move setting category icon from Core to CppTools
This image is used exclusively in the CppTools plugin,
thus belong into CppTools resources.

Change-Id: I8bbc553fb16897b74487ad27a941776b83f14d77
Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
2014-06-03 10:50:01 +02:00
Erik Verbruggen
a870c29a71 C++: use a global string table for SearchSymbols.
This string table uniques strings, so that multiple identical strings
share their contents. It is used by the locator and the symbol searcher,
and will later be used by the class view.

Change-Id: Ib8b50f69bbf994d0d7a39b66dc8caf1a3d9bfb42
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2014-05-28 15:54:38 +02:00
Christian Kandeler
080bd0df07 CppTools: Fix qbs build.
Change-Id: Iaf68f0c9b491454faebd7a232189152d97064c42
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2014-03-27 09:49:45 +01:00
Nikolai Kosjar
25be7e087d CppEditor: Extract CodeModelInspector::Dumper
Change-Id: I58acfb2d049dd4239a3f41b0a5795bfaab7b4f2f
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2014-03-26 15:57:27 +01:00
Joerg Bornemann
84df758ec6 use new base import style in qbs files
Change-Id: Iecf32122df41f304ec6df538bb0dd8a263238a86
Reviewed-by: Jake Petroules <jake.petroules@petroules.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2014-03-11 14:20:22 +01:00
Tobias Hunger
8c1c284789 Qbs/qmake: Fix dependencies of plugins
... based on output from dependencyinfo.py script

Change-Id: I9532f6d259f15c16b62fae0ca18f8a8cad95bd11
Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
2014-02-11 13:23:26 +01:00
hjk
4d96fa7aba Core: Merge Find and Locator into Core plugin
Change-Id: I7053310272235d854c9f409670ff52a10a7add8b
Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2014-01-14 07:43:00 +01:00
Nikolai Kosjar
5c8df5fa4e CppEditor/CppTools: Introduce Test{Case,Document}
Move common functionality of the 12 test classes into base classes.

Change-Id: If64d3cec876807ac6f991151189860a99b8ff4ca
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2014-01-07 14:19:13 +01:00
Nikolai Kosjar
7f829b26e5 Clean up {classview,cppeditor,cpptools}.{pro,qbs}
Mostly reordering files alphabetically.

Change-Id: Ibad1fa75559218fe488d1b31c7200ba4ff6131fe
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2013-12-11 11:46:42 +01:00
Nikolai Kosjar
273192759b CppEditor/CppTools: Move FunctionHelper to CppTools
...and rename it to FunctionUtils.

Change-Id: If076ec01fd82e8ba728764bdeab7e87e8bc1ff3b
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2013-12-11 11:46:33 +01:00
Nikolai Kosjar
7eeb87295b CppTools: Add basic test for TypeHierarchyBuilder
Change-Id: I7a82f2b22105d4e096fc0bd69679adacdde2c731
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2013-11-12 16:40:41 +01:00
Christian Kandeler
f1da03c73b qbs project files: Make use of new qbsSearchPaths property.
Change-Id: I396d970fafea1fd0b4c4d73883796662a1d0064b
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2013-10-09 18:08:56 +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
Orgad Shaneh
5dc583068a Mute MSVC safety warnings
Botan:
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xutility:2227:
warning: C4996: 'std::_Copy_impl': Function call with parameters that may be
unsafe - this call relies on the caller to check that the passed values are
correct. To disable this warning, use -D_SCL_SECURE_NO_WARNINGS. See
documentation on how to use Visual C++ 'Checked Iterators'

c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\xutility:2212:
see declaration of 'std::_Copy_impl'

D:\dev\qt-creator\src\libs\3rdparty\botan\botan.cpp:7248: see reference
to function template instantiation
'_OutIt std::copy<const Botan::u32bit*,T*>(_InIt,_InIt,_OutIt)' being compiled
with
[
    _OutIt=Botan::word *,
    T=Botan::word,
    _InIt=const Botan::u32bit *
]

CppTools:
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xutility:2873:
warning: C4996: 'std::_Mismatch1': Function call with parameters that may be
unsafe - this call relies on the caller to check that the passed values are
correct. To disable this warning, use -D_SCL_SECURE_NO_WARNINGS. See
documentation on how to use Visual C++ 'Checked Iterators'

C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\xutility:2856:
see declaration of 'std::_Mismatch1'

D:\dev\qt-creator\src\plugins\cpptools\symbolfinder.cpp:388: see reference to
function template instantiation 'std::pair<_Ty1,_Ty2>
std::mismatch<QString::const_iterator,QString::const_iterator>(_InIt1,_InIt1,_InIt2)'
being compiled
with
[
    _Ty1=QString::const_iterator,
    _Ty2=QString::const_iterator,
    _InIt1=QString::const_iterator,
    _InIt2=QString::const_iterator
]

Change-Id: I09a477e755c4555101b064271f10c08a69576e33
Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
Reviewed-by: David Schulz <david.schulz@digia.com>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2013-09-20 14:51:07 +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
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
Christian Kandeler
c2ac0902ed Move some functions out of defaults.js and make them project properties.
The one that is left is the only one that's actually a function taking
real input.
This saves a number of includes.

Change-Id: I77e777bbf6ed7ed4086f9a40de4dc3dd8c91a7af
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2013-09-09 12:04:01 +02:00
Christian Kandeler
0e66ac1e54 qbs project files: Fix some dependency exports.
Change-Id: I7049fcaab77639c17c4d0e74f7d9360a80fafcaa
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2013-09-09 12:03:44 +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
Orgad Shaneh
adee8336bb C++: Custom directory list for Switch Header/Source
Some projects use separate directories for sources and headers.

An example tree:
*
|-- src
     |-- foo.cpp
|-- include
     |-- foo.h

Allow the user to specify directories for finding out-of-project related
header/source files, in addition to current directory

Task-number: QTCREATORBUG-8883
Change-Id: I57215c8f2feffcc246d0d161798290861bcfcdd4
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2013-09-03 14:25:05 +02:00
Nikolai Kosjar
fc731a3a67 CppTools: Introduce LocatorData
Until now the locator filters CppLocatorFilter, CppClassesFilter and
CppFunctionsFilter used unnecessarily their own SearchSymbols instance.
The results were also saved separately, which was unfavorable since e.g.
the functions and classes data could be shared.

Starting with this patch an instance of LocatorData will serve all
mentioned filters.

This saves about 20MB of memory after indexing the Qt Creator project.

Change-Id: I8a34b67eb9fe0e5c68ba6e7c8f576389c78efc6f
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2013-08-30 16:42:26 +02:00
Nikolai Kosjar
fd9293dd0a CppTools: CppPreprocessor: Track also unresolved includes
Change-Id: Ia36e7e7142dbc030a428369ed04e76e70e8eef0b
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2013-08-22 11:57:27 +02:00
Nikolai Kosjar
d185849150 CppTools: Tests: Introduce basic BuiltinSymbolSearcher tests
Change-Id: I25f11e80747863f797d146980d8ee0e605acb6e5
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2013-08-20 14:18:45 +02:00
Nikolai Kosjar
dcf618469d CppTools: Tests: Add basic tests for locator filters
Change-Id: Ie71aa8a39f4584a024a4f104841ad8e57947e489
Reviewed-by: David Schulz <david.schulz@digia.com>
2013-08-19 14:43:58 +02:00
Nikolai Kosjar
f23fed601b CppTools: Tests: Move test includes utils into helper class
Change-Id: Ia679f3d2ae5fce0978a4e320fa18b28f1a7bed71
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2013-08-13 09:23:02 +02:00
Eike Ziller
ab0c3da08f Merge remote-tracking branch 'origin/2.8'
Conflicts:
	qtcreator.pri
	qtcreator.qbs
	src/plugins/projectexplorer/projectexplorer.cpp

Change-Id: I37e550646f877b50693043894976a693ac22ad5e
2013-07-11 08:02:41 +02:00
Tobias Hunger
81eba6f984 Move Ui code model support into QtSupport
* Move basic ui code model support from CppTools into QtSupport
* Use Kit infrastructure to retrieve uicCommand and environment
* Remove specialization for cmake projects (no longer needed)
* Remove specialization for qmake based projects (no longer needed)

Change-Id: I8569cc01acb46a540883c2da235d169bebf7db39
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
2013-07-10 14:36:17 +02:00
Christian Kandeler
f71bb6d348 Adapt qbs files to qbs.fileinfo renaming.
Also update qbs submodule so Creator can open itself.

Change-Id: Iaa70d5e83d07a1120e795046ebbd8995159aa2db
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
2013-07-09 16:21:24 +02:00
Nikolai Kosjar
f3186690bd CppEditor: Improve finding position for new includes
...by detecting include groups (separated by new lines, include types
and same dir prefix).

Task-number: QTCREATORBUG-9317
Change-Id: I73e80fdc715104901cb2d4f5b15b4cab5d04d305
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2013-06-11 15:57:10 +02:00
Eike Ziller
1b3bb5cb7e Consistently give qbs groups a name.
These nicely show up in the project tree in Qt Creator then.

Change-Id: I9782f5953d61940e6c2a0f61f07bb15aaeba49d9
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2013-06-06 13:40:51 +02:00
Eike Ziller
45f8e241ba Merge remote-tracking branch 'origin/2.7' into 2.8
Conflicts:
	src/plugins/android/androiddebugsupport.cpp
	src/plugins/qtsupport/qtsupport.qbs

Change-Id: I0953ca21a9db05084a79b8a6019189ea982df0b1
2013-05-27 17:17:40 +02:00
Joerg Bornemann
3eba7e44e5 rename ProductModule into Export
This fixes a bunch of warning when building with the updated qbs
version.

Change-Id: I644b4a4d0225b2e23ff1d9e1bf6d9d0136d6bbb5
Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
2013-05-27 09:59:53 +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
Tobias Hunger
ddafdf55de CppTools: Rename files to comply with coding standard
Rename ModelManagerInterface.(h|cpp) to cppmodelmanagerinterface.(h|cpp).
Rename TypeHierarchyBuilder.(h|cpp) to typehierarchybuilder.(h|cpp).

Change-Id: I035d833fd205d7460819bd0fb7031294359032f9
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2013-04-10 11:43:22 +02:00
Christian Kandeler
0a27f03264 CppTools: Fix qbs build.
Change-Id: Iab88214089c48e73c9dbc4e0b0cfded734e0be13
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
2013-03-25 14:53:19 +01:00
Nikolai Kosjar
138066792e C++: Introduce PointerDeclarationFormatter
For a given AST, CppRefactoringFile and Overview this will create a
ChangeSet for rewriting the pointer or reference declaration according
to the Overview.

Task-number: QTCREATORBUG-6169

Change-Id: If6f824c1ea5e9f53a11a58ec8b6d696d01f0723e
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2013-01-24 11:59:14 +01:00