Commit Graph

1199 Commits

Author SHA1 Message Date
Nikolai Kosjar
c264c0d213 C++: Fix resolving ui_* files in CppPreprocessor
The working copy contains the artificial ui_* files and therefore we
have to consider it while resolving include files.

Task-number: QTCREATORBUG-9683
Change-Id: Icb3387b4cd885b3652bae3f1da465d3e0f633332
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
Reviewed-by: Robert Loehning <robert.loehning@digia.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2013-07-02 12:09:43 +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
195d3c6f9e CppTools: "Switch Header/Source" checks also other projects
...and not only the current one as fallback.

E.g. if the projects qtcreator and qtbase are open and you navigate into
qdir.h of your include path from the qtcreator project and trigger
"Switch Header/Source", then "qdir.cpp" will be found in the qtbase
source dir.

Task-number: QTCREATORBUG-3789
Change-Id: Ibd73c37bb626f8f7ee80cd8be3ef1244883ccf5e
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2013-06-25 16:21:03 +02:00
Nikolai Kosjar
021dbc2e96 CppEditor: Respect whitespace in operator names for more quick fixes
* Affected quick fixes: InsertDefFromDecl, MoveFuncDefOutside
* Fix also reformating pointer declaration of operator functions for
  qualified name ids

Change-Id: I6a7578f496221557d103f5fdbb5dacc9540ee779
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2013-06-25 09:57:23 +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
Nikolai Kosjar
6df66e883f CppTools: Do not hand over partly reloaded files to the code model
When a reloading operation was in progress, CppEditorSupport::contents()
could return a partly reloaded file to the code model leading to parse
errors and incomplete highlighting.

Fixed by checking if the file is currently being reloaded.

Task-number: QTCREATORBUG-9382

Change-Id: Iee97e10444763c0cbf481132afa4617c5cdbd15c
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2013-06-24 11:13:35 +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
e11ee89916 C++: show signal declarations when searching for functions
Instead of showing all function declarations when searching for methods,
only show signal declarations. Otherwise, both function declarations and
their definitions would show up, which is not too useful.

Task-number: QTCREATORBUG-9543

Change-Id: Ia81e422e4c53dbc4199b30b1d362f4829b337a7f
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2013-06-18 11:22:24 +02:00
Nikolai Kosjar
5cb22e5021 CppEditor: Fix highlighting in new split if file is changed externally
For a new split/editor no CppHighlightingSupport was set since
onMimeTypeChanged was not called.

Now the CppHighlightingSupport is set again in the constructor. This
reverts partly

    commit 033ad887
    C++: handle file type changes for choosing highlighters

Task-number: QTCREATORBUG-9382
Change-Id: Ie79d357d570bec4920366fbd56fb67859be9b37a
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2013-06-17 10:36:39 +02:00
Nikolai Kosjar
8180f695f1 CppEditor: Check <include path>/QSomething
For the quick fix AddIncludeForUndefinedIdentifier, if no class is found
via the locator, check the "Qt include paths" for a header file with the
same name as the class name.

Task-number: QTCREATORBUG-9538
Change-Id: I13c86844c2ff653fa479dc91eb109af2a6d76fae
Reviewed-by: Lorenz Haas <lykurg@gmail.com>
Reviewed-by: hjk <hjk121@nokiamail.com>
2013-06-17 08:16:43 +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
Lorenz Haas
8f4c4b41f6 CppTools: Fix nextToSurroundingDefinitions
Now it is checked if the adjacent declaration is also defined and one
can define the destination file.

Change-Id: Ifff59c49fc2ab3e2f36f41df42ae4b7d7ff8dd35
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2013-06-12 16:32:14 +02:00
Nikolai Kosjar
546d297856 CppTools: Handle operator functions when reformatting */& declarations
Respect also whitespace within the operator names (e.g. "operator=" vs
"operator =").

Change-Id: Ibdfc77e9eebf7e3db31ccce7d8959b226dcda765
Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2013-06-11 16:32:24 +02:00
Nikolai Kosjar
50a900e509 C++: Handle recursive using/typedef declarations
Remember using/typedef declarations we have already looked up and
stop if we try it again.

Change-Id: I91bf0aef4df18539a47d015f0113543aef1f692a
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2013-06-11 16:30:58 +02:00
Nikolai Kosjar
8f1b665667 C++: Handle recursive auto declarations
Remember auto declarations we have already looked up and stop if we try
it again.

Task-number: QTCREATORBUG-9503

Change-Id: I989b11609c98bf197ce916d79c9d452294355053
Reviewed-by: Przemyslaw Gorszkowski <pgorszkowski@gmail.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2013-06-11 16:30:20 +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
Nikolai Kosjar
e3bc84c414 C++: Record also unresolved paths for includes
Change-Id: Id107b6c1f34f594c5a01502c156963c964235ed7
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2013-06-11 15:54:52 +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
7c8db79817 Switch less often to edit mode
This change
* Removes IMode::type, ModeManager::activateModeType, and
  IEditor::preferredModeType, and adds IEditor::isDesignModePreferred
  instead
* Adapts the mode switching code in EditorManager to handle multiple
  windows, for example switching to edit mode should only happen if
  the editor/view is in the main window. Otherwise the editor window
  should be raised and focused
* Renames EditorManager::NoActivate --> DoNotChangeCurrentEditor
* Reverts the EditorManager::ModeSwitch logic to switch mode or
  make the current editor visible by default, introducing
  DoNotMakeVisible flag instead
* Fixes a few instances where EditorManager::ModeSwitch should have been
  used

One non-trivial problem left: If you open a .ui file and switch to an
external editor window, edit mode is activated, because the current
editor no longer is a .ui file, which means that the design mode gets
deactivated.

Change-Id: I76c5c2391eb4090143b778fb103acff3a5a1ff41
Reviewed-by: David Schulz <david.schulz@digia.com>
2013-06-05 09:43:14 +02:00
Lorenz Haas
cc1b66f1cc CppTools: Open InsertionPointLocator::methodDefinition for symbols
Remove restricted use of declarations and add an option to define if
SymbolFinder should be used to find a matching definition for symbol.

Change-Id: If5cf5b11926e116766dd60dd3726b4fcf2e1c9f5
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2013-06-04 15:54:19 +02:00
Erik Verbruggen
ca291fbc7b C++: fix functionAt(), moved it, and added test.
Thanks to Jesper K. Pedersen for the fix!

Change-Id: Ie49c3352e26a9632b1500596b00d559bfe932dff
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2013-06-04 15:24:33 +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
6d544bc2ca C++: handle braced return statements in indenter.
Task-number: QTCREATORBUG-9314

Change-Id: I59c026cce02b85eeb54f4d10d5c9fb0c59bfe28a
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2013-06-03 15:17:16 +02:00
Eike Ziller
2125525e77 Move openEditorAt from BaseTextEditorWidget to EditorManager
More sensible place, gotoLine is a method in IEditor anyhow.

Change-Id: I420a6bf17060c16e6f1a4f45e0bef89379fb6bf8
Reviewed-by: David Schulz <david.schulz@digia.com>
2013-06-03 09:33:06 +02:00
Eike Ziller
97915bbcea Make 'open in other split' a flag instead of another method.
Change-Id: I1acafd85ec7a87ba2ac61240f30c329d56461118
Reviewed-by: David Schulz <david.schulz@digia.com>
2013-06-03 09:32:22 +02:00
Eike Ziller
7d986f0486 Cycle through extra editor windows when cycling through splits
Change-Id: I1bd5654d62b11456c35cc5bf1099e41fb3559bc7
Reviewed-by: David Schulz <david.schulz@digia.com>
2013-05-31 12:27:12 +02:00
Sergey Shambir
d8eb5ddb75 CppTools: cleanup CppPreprocessor header, added short docs.
Change-Id: Ib61197da939165d24b99e40f29f9de13d109e044
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com>
Reviewed-by: hjk <hjk121@nokiamail.com>
2013-05-31 10:53:18 +02:00
Sergey Shambir
0b724400aa CppTools: fixed wrong flags check.
Change-Id: I682e78c352066ddd05e96199fd8ead088e3e9f52
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2013-05-29 14:17:50 +02:00
hjk
8390a32131 Settings: Simplify some user code
This is still way too much boiler plate code for the task at hand.

Change-Id: Ia03bff3d6947ea6372e3f5d0217c116728742b74
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-05-29 09:40:17 +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
Eike Ziller
d8bd56bcd6 Merge remote-tracking branch 'origin/2.7' into 2.8
Conflicts:
	src/plugins/cpptools/cppcompletion_test.cpp
	src/plugins/cpptools/cpptoolsplugin.h
	src/plugins/qbsprojectmanager/qbsbuildstep.cpp
	src/plugins/qbsprojectmanager/qbscleanstep.cpp
	src/plugins/qbsprojectmanager/qbsnodes.cpp
	src/shared/qbs

Change-Id: I8fc97ed61c47af2c3d9e5cc2bf81e97661204d4e
2013-05-24 16:20:10 +02:00
Przemyslaw Gorszkowski
f93758b8e1 C++: fix used template function parameters
It was missing colorizing and follow symbol template function parameters in case of:
* returning value
* use it as qualified name

Task-number: QTCREATORBUG-6861

Change-Id: I4226199e1f296cfe5a373783ebbc633e32fc9bcd
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2013-05-24 14:23:14 +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
Przemyslaw Gorszkowski
a439d12b48 C++: fix typedefed struct
Fixed:
* replacing dot with arrow
* code completion

Task-number: QTCREATORBUG-7373
Change-Id: I6bd3781e91876567ce6f0d4160373438c756c417
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2013-05-24 11:46:48 +02:00
Przemyslaw Gorszkowski
783ec18424 C++: instantiate template functions
Task-number: QTCREATORBUG-9170

Change-Id: I4cac9124558c1d4f0722192246f3fbeea61d3d7d
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2013-05-24 11:43:52 +02:00
Przemyslaw Gorszkowski
80e1ae8059 C++: fix crash during code completion with base template class
ResolveExpression has to have a reference of ContextLookup. If not there
will be a crash because of deleted instanitated base template class.

Task-number: QTCREATORBUG-9329
Change-Id: I7f8c83da0d81ac6311e76d15a897adbc70b08d75
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2013-05-24 11:35:11 +02:00
Nikolai Kosjar
0d9bf5e543 C++: Fix 'already seen files' when indexing
Resetting the environment (after each *.cpp file) did not clear the
already seen files (m_included). Because of that the succeeding header
files were not parsed correctly - the environments of the mistakenly
already seen header files were not merged in.

Note that this change slow downs the parsing/indexing of files to its
original speed, as it was before the problematic commit (and it is in
2.7):

    commit 82e347095c
    C++: Untangle include file resolving from loading.

Task-number: QTCREATORBUG-9205
Change-Id: Iea57b7c59ea04a3c8843fd1291f4c375382958fc
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2013-05-23 08:37:36 +02:00
Nikolai Kosjar
3e80f52414 C++: Tests: Generalize for using different test data dirs
...for the modelmanager tests.

Change-Id: I91f163df1ed958a3915ce263b12e3e30cda0b78f
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2013-05-23 08:37:31 +02:00
Tobias Hunger
24ee641543 Fix dependency information according to output of dependency checker
Change-Id: Ic1259f04f4120b6e495ebb3672f7f360c71cba7f
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2013-05-22 16:41:39 +02:00
Erik Verbruggen
72ad68e913 C++: show function declarations in the locator.
When searching for functions/methods in the locator, also show function
and method declarations.

Task-number: QTCREATORBUG-8862
Change-Id: Ie86bfe82403d79a903d769860a472e2a20a2b9d0
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2013-05-15 16:55:54 +02:00
Erik Verbruggen
033ad8875b C++: handle file type changes for choosing highlighters.
If the file type (mime type) of an editor changes, it might need a
different kind of highlighter/highlighting-support.

Change-Id: I470dbf69e71856c9593d201416c4d4bd2958aaec
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2013-05-15 15:05:58 +02:00
Lorenz Haas
17a81ae106 CppTools: findMatchingDefinition handles const and volatile
Strict set to true, SymbolFinder::findMatchingDefinition will now also
check, if const and volatile matches.

Changed return type from 'Symbol *' to 'Function *' since only functions
are returned.

Change-Id: Ib55cb12b6c404e94fcefd0613b964e8caa425690
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2013-05-15 13:36:13 +02:00
Oswald Buddenhagen
6fb94a7b10 Merge branch '2.7'
Conflicts:
	doc/src/qtquick/qtquick-components.qdoc
	doc/src/qtquick/qtquick-designer.qdoc
	qtcreator.pri
	qtcreator.qbs
	src/plugins/cppeditor/cppinsertdecldef.cpp
	src/plugins/qnx/qnxruncontrolfactory.cpp

Change-Id: I0a37a07c42719bc0d9ef5b3ac4641d01a63c0d88
2013-05-15 10:21:47 +02:00
Lorenz Haas
d288e3999b CppEditor: Quick fix "Insert (Pure) Virtual Methods"
This quick fix inserts (pure) virtual functions of base classes to the
current class. For selecting the functions which should be inserted and
for choosing the insertion mode (only declarations or with definitions
inside, outside or in the implementation file) a dialog is shown.

Task-number: QTCREATORBUG-2210
Task-number: QTCREATORBUG-2692
Task-number: QTCREATORBUG-3908
Task-number: QTCREATORBUG-5868
Task-number: QTCREATORBUG-7982
Change-Id: I8e94905afcae4778986f4c3925a494e0c6b3b8ee
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2013-05-14 09:14:25 +02:00
Sergey Shambir
59b303fadc CppTools: ProjectPart now collects warning flags
Will be used by ClangCodeModel, but native model also can use it by
disabling unused variable/parameter warnings when needed.

Change-Id: I184efb3c65e893a2d85a933385cc547b646e6826
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2013-05-13 13:10:10 +02:00
Przemyslaw Gorszkowski
5dbcb974b0 C++: added missing cloning of AnonymousNameId
When instantiate a template with anonymous class/struct/union
AnonymousNameId has to be cloned.

Task-number: QTCREATORBUG-9227

Change-Id: Iedca5e41589e68a94a35cd4387241052c70c50df
Reviewed-by: Sergey Shambir <sergey.shambir.auto@gmail.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2013-05-10 11:16:04 +02:00
Nikolai Kosjar
934cea560d CppEditor: Fix crash when closing editors fast
Task-number: QTCREATORBUG-9250

Change-Id: I15bcaf5d0e55c7e3cc731755fc48df2d1181f3da
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2013-05-08 10:29:10 +02:00
Nikolai Kosjar
5b30509a99 CppEditor: Fix highlighting if there are unconfigured projects
If Creator switched to the Project mode on startup, the highlighting was
not started because the editor widget was not visible. Now we check if
the editor itself is or would be visible in the edit mode, which is
indepedent of the current mode.

Task-number: QTCREATORBUG-9260
Change-Id: I72373e09965fd1cded034ae4711df48798e7f0d8
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2013-05-07 11:45:59 +02:00
Nikolai Kosjar
cacd66195c CppEditor: Avoid premature calls to recalculateSemanticInfoNow
Now recalculateSemanticInfoNow is called only once instead of three
times when a new editor is opened/created.

Change-Id: Ife84fc9ca90cdbf2a417123e6a2b9e1e068dfdc4
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2013-05-07 11:45:46 +02:00