...since by now we get the defines in the correct format from
QMakeProject.
See the change this one depends on.
Tested with:
Qbs: cpp.defines: [ 'PATH1="/some/path"', "PATH2=\"/some/path\"" ]
QMake: DEFINES += PATH1=\\\"/some/path\\\" "PATH2=\\\"/some/path\\\""
CMake: add_definitions(-DPATH1="/some/path" "-DPATH2=\"/some/path\"")
All these lines translate to
#define PATH1 "/some/path"
#define PATH2 "/some/path"
for the code model.
Change-Id: Ifc3d3acff3abab6897ccbd0c5fafd5c415dfb53c
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
Not all defines make sense for non-compilation purposes.
Change-Id: I7c5dd5aaa6de5c8916dfc10eb54ae49efa22959d
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
"#define XYZ" does not correspond to "-DXYZ" (which means
"#define XYZ 1"), but to "-DXYZ=".
Change-Id: I3ed44e1457b3df52dc9bdb930ba8f4a04784d207
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
* Cuts direct dependency to CPlusPlus from cppeditor.h, but
cppfunctiondecldeflink.h still pulls it in.
* Cuts direct dependency to
cppeditor.h from cppvirtualfunctionassistprovider.cpp, but it still
depends on cppeditorconstants.h.
* Cuts direct dependency to cppeditor.h from cppelementevaluator.cpp.
The long-term goal is to make the CppEditor independent from concrete
code model backends.
Change-Id: I291ee0d0da5fc5ed1a839a763fe7be11dcf7a6fb
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
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>
We will introduce a base class with the name
CppCompletionAssistProcessor.
Change-Id: I74a39d0b14d4ee30d7bd7675ad968e83f377de7f
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
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>
...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>
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>
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>
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>
Take 2
Task-number: QTCREATORBUG-13757
Change-Id: I9c2558bf01121e53710db984a99d37c2c6cafaf4
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
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>
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>
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>
Breaks loading of qtcreator project.
This reverts commit 4c6ad5e305.
Change-Id: I7c4cdaf57eed16d7643d05b9456e03d5120259b3
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
* 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>
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>
The GenericProjectManager tests left over some state in CppModelManager.
Change-Id: I3f5c5bf27b9443e6753eb6c24114e2e5b99e7372
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
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>
* 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>
...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>
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>
... by keying on Utils::FileName.
Task-number: QTCREATORBUG-12390
Change-Id: Ib99eefcf3440d4383f624a614a3093f427efffbd
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
... by keying on Utils::FileName
Task-number: QTCREATORBUG-12390
Change-Id: Ia98afb5a9160a7fd9225a2f9e02539ff3c35ae86
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
This translates into "[" on compilers that handle digraphs.
Change-Id: Iba650d6929a1d3850018203b4f8331888ec8a257
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
...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>
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>
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>
...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>
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>
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>
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>