Commit Graph

1415 Commits

Author SHA1 Message Date
Przemyslaw Gorszkowski
5be56c073e C++: fix endless loop during template instantiation
This is the first phase of fixing bug QTCREATORBUG-10320.
This change resolves typedefs of template parameters(and resolves
problem with endless loop).

The next step will be matching appropriate template specialization
(this is needed to solve problem with missing code completion).

Missing matching: template specialization with the same parameters,
e.g.:
template <class T1, class T2, class T3>
class T
{
};

template <class T1, class T2>
class T<T1, T2, T2>
{
};

Task-number: QTCREATORBUG-10320
Change-Id: Icb6b539c021b2a67a66db9011a2e627f7d96526b
Reviewed-by: Przemyslaw Gorszkowski <pgorszkowski@gmail.com>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2013-10-17 11:43:27 +02:00
Eike Ziller
4e32babc44 Merge remote-tracking branch 'origin/3.0' 2013-10-16 11:22:20 +02:00
hjk
2b532c73ee CPlusPlus: Make (sub-)languague selection more generic
Change-Id: I4e2df6992b446adec662ab07671acd41715e41fd
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2013-10-15 16:22:28 +02:00
Eike Ziller
8474a6f128 Merge remote-tracking branch 'origin/3.0' 2013-10-14 15:31:54 +02:00
hjk
f463c4dade ProjectExplorer: Make Project::id value based
Change-Id: Ie210d2a068158c6caaac66aae58cbd886f61c18d
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
2013-10-14 13:35:59 +02: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
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
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
Nikolai Kosjar
802b67ff04 CppTools: Protect SnapshotUpdater getters by mutex
Task-number: QTCREATORBUG-10282

Change-Id: Ia58359f774c72260956caecd5f63d44b612d1451
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2013-10-09 15:01:42 +02:00
Orgad Shaneh
f47c101b8b Revert "EditorManager: Fix crash when closing an editor upon activation"
Deleting an editor while currentEditorChanged is apparently not a good
idea.
Use a queued connection instead.

This reverts commits 243a625961,
447c4ed37f,
d9602ca550 and
3103487038.

Change-Id: Iccbee25fb77714963faa6f7184d1f5f53ed348a6
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2013-10-08 17:09:55 +02:00
Nikolai Kosjar
872bfb7094 CppTools: Adapt C++ locator names to reality
The new names are:

* C++ Methods in Current Document -> C++ Symbols in Current Document
* C++ Classes and Methods -> C++ Classes, Enums and Functions
* C++ Methods and Functions -> C++ Functions

Further notes:

* "C++ Classes" stays the same.
* The term "Methods" was removed since "Functions" says it all (member
  functions, non-member functions). Because of this, the "m" shortcut
  for this filter does not fit so well to the name anymore.
* "C++ Symbols in..." - "Symbols" means the same as in the C++ Search
  dialog: classes, enums, functions and declarations

Change-Id: I8e5f410f2dcb1fafe83d0a1c8607f4c17eabbb8c
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com>
2013-10-07 12:06:20 +02:00
Oswald Buddenhagen
44dd2b6bdf fix build against qt4
Change-Id: I1884f6e61dcae95817da10f0ead67f2df99b4ec7
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2013-10-02 15:49:14 +02:00
Nikolai Kosjar
cd4c4218e4 CppTools: Fix completion in other editor
On duplication of an editor onMimeTypeChanged() of CppToolsEditorSupport
was not triggered, thus not completion provider was set.

Task-number: QTCREATORBUG-10284

Change-Id: Ia1da7f59b19e042f65b068a993f0d5c04b0778e0
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2013-10-02 12:13:31 +02:00
Nikolai Kosjar
9a97c42412 CppTools: De-duplicate some code in cppmodelmanager_test.cpp
Change-Id: I371e986c9b41fec5cddf05e3f7849c5e0b9e6b69
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2013-10-02 10:29:06 +02:00
Nikolai Kosjar
8d6ea45126 CppTools: Show function args in current document filter
Regression introduced by commit 190fb44.

Change-Id: Ibd47b6d316e5ae976fb448aad5062eb5887f10e6
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2013-10-02 10:28:58 +02:00
Nikolai Kosjar
3103487038 Tests: Move TestDataDir into plugintestutils.{h,cpp}
Change-Id: I76d5e421258eda85907e56762a59894ce7f84f13
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2013-10-02 10:25:07 +02:00
Nikolai Kosjar
f47e7f68d9 TextEditor: De-noise IAssistProcessor derived classes
...by providing a default implementation of immediateProposal() in the
base class.

Change-Id: I4f4f9aa491fbfc9390cc7b7093f1b3c1c8e460a4
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2013-10-02 10:24:17 +02:00
Daniel Teske
e462c9620d ProjectPart: Add meta information
Add displayname and project file path and a pointer back to the
project.

Change-Id: Ic9a18f52a6291493bd3a95fd3456ed0e1a3c63e3
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2013-10-01 16:31:36 +02:00
Joerg Bornemann
321ac6cc51 CppEditor: fix "follow symbol under cursor" for operators
Like for functions we can call attemptFuncDeclDef for operators. The
check for function names has been enhanced to take operators into
account.
For the switch from definition to declaration
SymbolFinder::findMatchingDeclaration has been enriched with operator
knowledge.

Task-number: QTCREATORBUG-7485

Change-Id: I29eebee337e26c8bf67dc8b4a15c43883045589d
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2013-10-01 15:43:33 +02:00
Erik Verbruggen
7b2c26204a CppTools: add method to manually set the project part.
Change-Id: Ic3578bd98c2f1aefcaef61f5b993dc9a67ca5a77
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2013-10-01 14:37:08 +02:00
Nikolai Kosjar
3a64f8a344 TextEditor: CodeAssist: Allow immediate proposals
Immediate proposals are displayed for asynchronous providers and fragile
proposals.

The idea is to show already available results immediately. The proposal
calculated in the process runner can then replace the immediate
proposal.

Change-Id: I7903e6677c9dfeb4957eb416062fff1fb01ff23f
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2013-10-01 14:04:06 +02:00
Erik Verbruggen
8c79d5bc23 C++: add code-model support for defines-per-editor.
The UI side will come in another commit.

Change-Id: I1038a438587fe4cef70408f7f627d08837fc192d
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2013-10-01 13:03:47 +02:00
Erik Verbruggen
507452f097 CppTools: honor pre-compiled headers in the code-model.
Task-number: QTCREATORBUG-476

Change-Id: I82ed92acdcda551d2c6a9ca221832ac20117a08f
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2013-10-01 13:02:45 +02:00
Orgad Shaneh
e4f762deec Fix compilation with Qt4
Change-Id: I486198c9d7e27159445411c38037d315b90cd67a
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2013-10-01 12:40:15 +02:00
Nikolai Kosjar
243a34c7ee CppTools: Fix test_modelmanager_defines_per_project
Change-Id: Ia2e4dc776d3040d2ccb13d9b029c2f0cc8db0fcd
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2013-10-01 10:46:33 +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
Nikolai Kosjar
447c4ed37f CppEditor/CppTools: Fix plugin tests in master.
Change-Id: Ia641c70f8c72cf762cf571cdd505385d28492b7c
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2013-10-01 10:25:31 +02:00
Eike Ziller
a0b2d10822 Merge remote-tracking branch 'origin/2.8'
Conflicts:
	src/plugins/coreplugin/coreplugin.pro
	src/plugins/coreplugin/coreplugin.qbs
	src/plugins/cppeditor/cppdoxygen_test.cpp
	src/plugins/cppeditor/cppquickfix_test.cpp
	src/plugins/cppeditor/followsymbol_switchmethoddecldef_test.cpp
	src/plugins/cpptools/cppcompletion_test.cpp

Change-Id: I392229af933c1e56b9ea459d4d240a2144b4bfcb
2013-10-01 10:04:18 +02:00
Nikolai Kosjar
d9602ca550 CppEditor/CppTools: Fix plugin tests.
Starting with commit 243a625 EditorManager::closeEditors() does not
delete the editors anymore, but calls deleteLater(). When the call
returns, all kind of checks fail since the editor widget destructor was
not yet called.

Fixed by providing and calling Core::Tests::closeAndDeleteEditors(),
which explicitly sends QEvent::DeferredDelete to the widget.

Change-Id: I3287abbe74ccf7d7a18b997a847701c8be17cb55
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2013-09-30 12:13:28 +02:00
Eike Ziller
63ff745213 Merge remote-tracking branch 'origin/2.8'
Conflicts:
	src/libs/extensionsystem/pluginmanager.cpp
	src/libs/extensionsystem/pluginspec.cpp
	src/plugins/coreplugin/basefilewizard.cpp
	src/plugins/coreplugin/coreplugin.pro
	src/plugins/coreplugin/coreplugin.qbs
	src/plugins/coreplugin/editormanager/ieditor.cpp
	src/plugins/coreplugin/externaltool.cpp
	src/plugins/coreplugin/icore.cpp
	src/plugins/cpptools/cppmodelmanager.cpp
	src/plugins/fakevim/fakevimhandler.cpp
	src/plugins/find/ifindfilter.cpp
	src/plugins/projectexplorer/buildstep.cpp
	src/plugins/projectexplorer/devicesupport/idevice.cpp
	src/plugins/projectexplorer/runconfiguration.cpp
	src/plugins/vcsbase/vcsbaseeditor.cpp
	tests/system/suite_debugger/tst_simple_analyze/test.py

Change-Id: I11dc9e60bfc14bad4f8af747d041fc7678a07c17
2013-09-27 10:44:32 +02:00
hjk
9c2a7c7c76 TextEditor: Use direct interface for registerMimeTypeForLanguageId
Change-Id: I6984173acf86e80175f9e2346315b5b226d6bde9
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
Reviewed-by: David Schulz <david.schulz@digia.com>
2013-09-26 11:08:19 +02:00
hjk
09aad1ac4d CodeStyleSettings: De-noise user code by using QByteArray ids.
Change-Id: Ia7210b0ff85667951e4e5554155d89ed6925f9ec
Reviewed-by: David Schulz <david.schulz@digia.com>
2013-09-25 09:43:22 +02:00
Erik Verbruggen
8350c4bdc2 C++: fix multi-byte character handling in input.
Temporary fix: if a single byte is found with the highest bit set, then
convert from utf8 to latin1. This can be removed when the lexer can
handle multi-byte characters.

Task-number: QTCREATORBUG-10141
Change-Id: I36a17aa18bd1b2378f12d0cecf4fd4957b38d8f2
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2013-09-23 14:55:28 +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
hjk
ca15d0aa95 Apply static pattern to TextEditorSetting
Change-Id: I4e6f573d893c0aa2bb4ca9812fc8db2961dac172
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
2013-09-20 10:28:22 +02:00
Nikolai Kosjar
190fb44882 CppTools: Fix qualified ids in the symbol searcher
The leaves in the treeview contained qualified ids.

Change-Id: I290eaf9b1e666b6879d6d4b1f2483cfe7fb85362
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2013-09-13 15:41:02 +02:00
Nikolai Kosjar
75b0429e29 CppTools: Locator Tests: Make test data more descriptive
Change-Id: I23e88c8a04f82d51651038b38faf07057244fede
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2013-09-13 15:40:55 +02:00
Nikolai Kosjar
91dbac0303 CppTools: Fix qualified ids in the ':' locator filter
* Always display qualified ids in the ':' filter
* Show correct qualified ids (for some symbols the namespace was shown
  twice)

Task-number: QTCREATORBUG-10136

Change-Id: Id178cb4b8abcc316250fa16e5f3e5a8e72bc0c10
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2013-09-13 15:40:48 +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
Tobias Hunger
5c33742375 CppTools: Remove dead code
Change-Id: I89e544946ff06593cb16badfb39a04f9d22924ef
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
2013-09-12 13:55:13 +02:00
Nikolai Kosjar
87e793d089 CppTools: Initialize pointer to 0
Change-Id: I55ec2d98b5fe72936ae7073e211fc6297334daba
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
2013-09-11 15:47:49 +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
Nikolai Kosjar
bbdee91bc9 CppTools: Handle erroneous statements in FindMethodDefinitionInsertPoint
...at end of file.

Change-Id: Ife8142cd9cf3c5e4be2594b7cc635e5ab7b9e946
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2013-09-09 15:48:59 +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
Leena Miettinen
83aad38cf6 Doc: edit cpptools docs
Remove \briefs from function descriptions and use standard
wording in them.
Use standard wording for \enum.
Replace \param with \a.

Change-Id: If429b6fc67ef6d1313c18f6111aa84f9c996189f
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2013-09-09 11:24:23 +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