Commit Graph

1701 Commits

Author SHA1 Message Date
Nikolai Kosjar
046f510e19 CppTools: Fix revision check in CppLocatorData
Bug was exhibited by running e.g.

 ./qtcreator -test CppEditor,test_quickfix_MoveFuncDefOutside_FreeFuncToCppNS \
   -test CppTools,test_cpplocatorfilters_CppLocatorFilter:CppFunctionsFilter-WithNamespacePrefix

Change-Id: I57d96a8f7bf0aea6eb11cb68d1b981808533ce41
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-01-21 09:41:38 +01:00
Nikolai Kosjar
4d3d0e0290 CppTools: Rename EditorDocumentHandle to CppEditorDocumentHandle
...and related functions. For clarity in client code.

Change-Id: Icad6fc7b1eee2ce46a2eba8435359837a23409c8
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
2015-01-14 12:33:15 +01:00
Nikolai Kosjar
845cb2e432 C++: Better names for Scope's iterators
Scope::lastMember() was misleading.

Change-Id: I953d489b8a2a9b86321f73cad3b7b371c4acf91f
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Przemyslaw Gorszkowski <pgorszkowski@gmail.com>
2015-01-14 12:29:37 +01:00
Nikolai Kosjar
d9c70f43d9 CppEditor: Tests: Use QTemporaryDir and avoid writing into creator source tree
This should improve results of CI tests where multiple creator instances
execute the plugin tests.

Change-Id: I557a0964568655662108df201589ba369096f4bf
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-01-14 12:10:39 +01:00
Nikolai Kosjar
71c27ba4cc CppTools: Consider unresolved includes for new include directive position
Now adding a new include directive by the refactoring action will cover
more cases.

This will also help us to simplity the corresponding tests, since it is
not necessary anymore to create actual files.

Change-Id: Id7612b13c392735d6ae1fb2ce3c36169eff3628e
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
2015-01-14 12:07:18 +01:00
Nikolai Kosjar
dbeae8cb43 C++: FastPreprocessor: Add only includes if there are none
For the case that the document is based upon another one (see
Snapshot::preprocessedDocument(), the only client of FastPreprocessor)
the FastPreprocessor added extra unresolved includes.

Change-Id: I0a7719fa8806af59f87a48bc6914270efd653e84
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
2015-01-14 12:07:03 +01:00
Orgad Shaneh
33ae764554 C++: Fix completion for enum inside member functions
Take 2

Task-number: QTCREATORBUG-13757
Change-Id: I9c2558bf01121e53710db984a99d37c2c6cafaf4
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-01-13 18:09:15 +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
Orgad Shaneh
c6a983d271 Core: Use FileName for file path in IDocument
Change-Id: I85f7398aee59d0d36f0e5c3bf88ff3c96002e394
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2015-01-12 10:23:37 +01:00
Eike Ziller
b5b47f7df2 Merge remote-tracking branch 'origin/3.3'
Conflicts:
	src/plugins/cppeditor/cppdocumentationcommenthelper.cpp

Change-Id: I2cf25eba1de149765a6c44ad354d606ce9de512d
2015-01-08 10:38:20 +01:00
Christian Stenger
91fabc4868 CppTools: Fix hanging test on OSX
Temporary directory is created in a folder having a symbolic link,
verification was done with the unresolved path and failed.

Change-Id: I40c943a307fe136a0f3f6fdbea5145296a63a19e
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-01-07 15:21:18 +01:00
Nikolai Kosjar
a5e2b4b149 CppTools: Check for valid active target
The active target might be 0 if e.g. there are not kits and a project is
imported.

Task-number: QTCREATORBUG-13730
Change-Id: I48ade507fefc555d1d3f8230ba82c00270fa457b
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2015-01-06 10:19:03 +01:00
Orgad Shaneh
9180555f26 Revert "C++: Fix completion for enum inside member functions"
Breaks loading of qtcreator project.

This reverts commit 4c6ad5e305.

Change-Id: I7c4cdaf57eed16d7643d05b9456e03d5120259b3
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-01-06 10:02:12 +01:00
Orgad Shaneh
4c6ad5e305 C++: Fix completion for enum inside member functions
Task-number: QTCREATORBUG-13757
Change-Id: I283306b0c8348ee82e8e9bf47d404c1ecd473fde
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-01-06 09:34:45 +01:00
Orgad Shaneh
fb396ffbd4 CppTools: Cover all permutations for each enum testcase
* named enum, access by value names
* named enum, access by enum name (C++11)
* anonymous enum

+ Add some failing tests

Task-number: QTCREATORBUG-13757
Change-Id: I7b0a859805a5979c3c886a6dbec703639fb374be
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-01-06 09:23:08 +01:00
Nikolai Kosjar
6cafc424e8 CppTools: Tests: Stop writing into source dir
Instead, always write into a unique temporary directory in
QDir::tempPath().

Where applicable, read the test source from files instead of first
writing the file.

Some clean ups in test_codegen*.

Change-Id: Id48dc50c6ca16252edfd9fc8a86ba0de9f9be486
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
2014-12-19 10:29:16 +01:00
Nikolai Kosjar
cb3c7538be CppTools: Fix flaky test_cpplocatorfilters_CppLocatorFilter
The GenericProjectManager tests left over some state in CppModelManager.

Change-Id: I3f5c5bf27b9443e6753eb6c24114e2e5b99e7372
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2014-12-19 10:25:03 +01:00
Nikolai Kosjar
b94b7b3ee6 CppTools: Fix test_modelmanager_extraeditorsupport_uiFiles
The test was broken since the QmakeProject was changed to work
asynchronously.

FAIL!  : CppTools::Internal::CppToolsPlugin::test_modelmanager_extraeditorsupport_uiFiles() Compared values are not the same
   Actual   (workingCopy.size()): 1
   Expected (2)                 : 2

Change-Id: I6f7d05fb70af3def5fc371a9783b606309686e32
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2014-12-19 10:24:55 +01:00
Nikolai Kosjar
ef403a4515 GenericProjectManager: Tests: Clean up
* Get rid of CppModelManagerHelper.
  Now we simply use CppModelManager::projectInfo(someProject).isValid() to
  test whether a project is loaded.

* Copy project data to temporary dir before opening the projects.
  This avoids creating *.user files in the Qt Creator source tree and
  annoying pop ups on test start.

Change-Id: I1a57441ca2099beb6bb96cf620390d669fb47601
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2014-12-19 10:24:48 +01:00
Nikolai Kosjar
fb8e3b9963 CppTools: Clean up commentssettings
Change-Id: I397195a3e6d8b40a55d2a68429daf6c812f52da2
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
2014-12-19 10:24:26 +01:00
Nikolai Kosjar
205170a9e5 CppTools: Create ProjectInfos explicitly
...instead of going through CppModelManager::projectInfo().

Now CppModelManager::projectInfo() returns an invalid ProjectInfo in
case there is no valid data for the given Project.

Change-Id: I11908bf2ddf865b1d3d71ff176eaf4139292b21c
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
2014-12-19 10:16:37 +01:00
Eike Ziller
b2bb7ea2da Locator: Shuffle the priorities a bit
Introduce a "Highest" priority for the filters-filter. Keep "Low"
available for lower priority than the default all projects and current
project filter.

Change-Id: I9152d2e6c64b65478416cee18183bce1240ee187
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2014-12-18 12:30:47 +01:00
Erik Verbruggen
7d377850d0 C++: handle case-insensitive file names for project files.
... by keying on Utils::FileName.

Task-number: QTCREATORBUG-12390
Change-Id: Ib99eefcf3440d4383f624a614a3093f427efffbd
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2014-12-18 11:54:12 +01:00
Erik Verbruggen
a48adcf9be C++: handle case-insensitive file names in the CPlusPlus::Snapshot
... by keying on Utils::FileName

Task-number: QTCREATORBUG-12390
Change-Id: Ia98afb5a9160a7fd9225a2f9e02539ff3c35ae86
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2014-12-17 14:32:17 +01:00
Ulf Hermann
4b5d38c8cc C++: Avoid digraph "<:" in template specialization
This translates into "[" on compilers that handle digraphs.

Change-Id: Iba650d6929a1d3850018203b4f8331888ec8a257
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2014-12-15 17:06:05 +01:00
Erik Verbruggen
be4a030696 C++: handle case-insensitive file names in the WorkingCopy
... by keying on Utils::FileName

Task-number: QTCREATORBUG-12390
Change-Id: Ia1a59d2e422b4f92300ac6a8e0e52dd7456a6e70
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2014-12-15 15:58:25 +01:00
Nikolai Kosjar
e3977de08e C++: Finish gcc's include_next support
This implements the actual include_next logic and thus completes

    commit b934cc1
    C++: pass #include_next down to CppPreprocessor::tryIncludeFile

    commmit 140b502
    C++: Highlight argument to gcc's #include_next extension

Based on https://gcc.gnu.org/onlinedocs/cpp/Wrapper-Headers.html

Task-number: QTCREATORBUG-10225
Change-Id: I7eef7f5ea64a114f6d092304d32b72c55c2ce134
Reviewed-by: hjk <hjk121@nokiamail.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
2014-12-15 15:37:36 +01:00
Nikolai Kosjar
ec6c13d02c TextEditor: Make automatic completion timeout configurable
Allow to configure the timeout in the range from 0 to 500ms.

Task-number: QTCREATORBUG-13393
Change-Id: I3e421109db919ab0dd5d63b8cbb9339fce132dbb
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
2014-12-15 15:24:37 +01:00
Nikolai Kosjar
65bb5856d0 CppTools: Do not append '/' to fallback header paths
...since this will confuse the completer.

Task-number: QTCREATORBUG-13567
Change-Id: I4172d433f23f3907690d4c00f92fadb68fa354e8
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2014-12-15 14:33:52 +01:00
Eike Ziller
541d00453a Merge remote-tracking branch 'origin/3.3'
Conflicts:
	qtcreator.pri
	qtcreator.qbs
	src/plugins/projectexplorer/projectexplorer.cpp
	src/shared/qbs

Change-Id: I6d91042bb48314d00be721099aed19feca74e0ce
2014-12-10 13:20:02 +01:00
Nikolai Kosjar
6b894b50e6 CppTools: Remove QTC_ASSERT in CppModelManager::editorDocument()
This fixes

    SOFT ASSERT: "!filePath.isEmpty()" in file
    /home/nik/dev/creator/creator-ut/src/plugins/cpptools/cppmodelmanager.cpp,
    line 467

which can be triggered by e.g. a "git show" document
(onCurrentEditorChanged does not check for an empty file path).

Change-Id: If4ed8e552069b290cb4ac93da52427b7ed2b91e8
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2014-12-03 13:07:58 +01:00
Daniel Teske
4943510b60 Completely rework currentNode/currentProject handling
Centralize the handling inside a new class ProjectTree.
React to moving focus and remove most special handling.

This properly fixes the linked task.

Task-number: QTCREATORBUG-13357
Change-Id: I6b06aa32b1e4305ec8a6d432857b302585d8734b
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2014-12-03 12:36:20 +01:00
Nikolai Kosjar
cb0d136926 CppTools: Update document on activation
...if the project was updated in the meanwhile.

If a project is updated mark invisible editor documents dirty and update
them if they get focus.

This also fixes document highlighting when restoring a session for
documents that the user "switched away" before the project info is
pushed to CppModelManager.

This completes

    CppTools: Update visible documents on project update
    commit c2eb91e053

which only takes care of visible documents.

Task-number: QTCREATORBUG-13270
Change-Id: Id445e7f509deac5d03194aecc54ce4629b7926ce
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
2014-12-03 10:53:39 +01:00
Nikolai Kosjar
9cd552a165 CppTools: Do not offer pointless ")" signature completion
If "Automatically insert matching characters" is activated and '(' is
typed before the semicolon in the declaration

    int f;

we offered the ')' completion, although the ')' was already inserted.

Change-Id: Id5a50fa94c2cb7b5c4056d87028501b0b90afc73
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
2014-12-03 10:37:24 +01:00
Eike Ziller
d341c48246 Merge remote-tracking branch 'origin/3.3' 2014-12-01 15:44:30 +01:00
Nikolai Kosjar
9ccb6b81c9 CppTools: Fix include hierarchy for clang code model
This makes the editor document snapshot accessible through
BaseEditorDocumentProcessor since we need it for the include hierarchy
if the the clang code model is activated.

Task-number: QTCREATORBUG-13553
Change-Id: I7214cc578d05fe5cad6e12b4d29fe6f840a88e8d
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
2014-11-28 14:20:29 +01:00
Nikolai Kosjar
488bf91797 CppTools: Always check for a valid BuiltinEditorDocumentParser*
This fixes a crash if the include hierarchy sidebar is invoked with the
clang code model. BuiltinEditorDocumentParser::get(editorFilePath)
returns 0 in that case.

Task-number: QTCREATORBUG-13553
Change-Id: I9292691c8156bdaaffcac1c3864201ba8a6cbdef
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
2014-11-28 14:20:23 +01:00
Eike Ziller
938326ef2c Merge remote-tracking branch 'origin/3.3' 2014-11-26 11:11:46 +01:00
hjk
96be6ae15f TextEditor: Shuffle some convenience functions
Remove rarely used ones, add a currentTextEditorWidget()

Change-Id: I27b97c17927c71e07dc3b489785b7f2f76eb801e
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2014-11-25 10:49:41 +01:00
Eike Ziller
a47fbb8309 Merge remote-tracking branch 'origin/3.3'
Conflicts:
	src/plugins/coreplugin/coreplugin.cpp
	src/plugins/coreplugin/themesettingswidget.cpp
	src/plugins/qbsprojectmanager/qbsprojectmanager.cpp
	src/plugins/qbsprojectmanager/qbsprojectmanager.h
	src/plugins/qmlprofiler/qml/Overview.js
	src/shared/qbs

Change-Id: Ibe92c166fc5bfbcb4d6964e50ca7298d8459d60e
2014-11-24 15:43:48 +01:00
Nikolai Kosjar
2f3e8c7981 CppTools: Remove QTC_ASSERT
A DiffEditorDocument has an empty file path.

Change-Id: If097497514afa82b1ed220a37cae410f4a81aa9a
Task-number: QTCREATORBUG-13489
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2014-11-24 13:28:58 +01:00
jkobus
e338e78e85 Add an explanation to the "Automatically Split Strings" feature.
Change-Id: Ie046c9db2544e22937968d6673f0813d59e2dc93
Reviewed-by: Jarek Kobus <jaroslaw.kobus@theqtcompany.com>
Reviewed-by: hjk <hjk121@nokiamail.com>
2014-11-21 16:54:07 +01:00
Christian Stenger
38c08abde5 ProjectPartBuild: Fix framework paths
Task-number: QTCREATORBUG-13137
Change-Id: I71a222a4048db65db462da07726ea5d6b917da8d
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
2014-11-20 15:06:19 +01:00
Nikolai Kosjar
beac7b9539 C++: Fix highlighting after "invalid code"
For the semantic info document we do not expand function like macros and
because of that certain macro invocations lead to invalid code that we
need to handle, e.g.:

	Q_GLOBAL_STATIC(CppTools::SymbolFinder, symbolFinder)
	class Foo {};

This change makes parsing Foo in the semantic info document successfully
again, which affects highlighting of that class.

Change-Id: I389265ac64d3f0b8b8f406d38fa58d78820b14ba
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
2014-11-19 16:10:56 +01:00
Erik Verbruggen
6cfd843580 C++: Only start/stop timers from the UI thread.
Change-Id: Ib694d2aeaef3b62caf3d3624e6b1c3e643197c2d
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2014-11-18 11:02:24 +01:00
Eike Ziller
2d03b59f53 Merge remote-tracking branch 'origin/3.3'
Change-Id: I0ab4982e229d475b8e3575414b4bebbfea07498d
2014-11-12 12:55:10 +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
Nikolai Kosjar
e510c80c92 CppTools: Provide whether a sub project is selected for building
Analyzers can use this to rule out irrelevant (sub) projects.

Change-Id: I5a9eb66f06156f0619dc639f6f4080a8fc761ee6
Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>
2014-11-07 12:10:22 +01:00
Nikolai Kosjar
33359a7922 CppTools: Add API to set/query compiler call data
...and make some comparison functions public.

Change-Id: If4c9a95031dece32073ce111484a890230190688
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@theqtcompany.com>
2014-11-07 10:27:17 +01:00
Eike Ziller
ec176b4bf4 Merge remote-tracking branch 'origin/3.3'
Change-Id: I3a8ef73222c64fb93f1d00adbea2057d2f8dcf43
2014-11-07 08:19:34 +01:00