summaryrefslogtreecommitdiff
path: root/src/plugins/cpptools/cppprojectfile.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Merge CppTools into CppEditorChristian Kandeler2021-09-011-195/+0
| | | | | | | | | | | | | | | | There was no proper separation of responsibilities between these plugins. In particular, CppTools had lots of editor-related functionality, so it's not clear why it was separated out in the first place. In fact, for a lot of code, it seemed quite arbitrary where it was put (just one example: switchHeaderSource() was in CppTools, wheras switchDeclarationDefinition() was in CppEditor). Merging the plugins will enable us to get rid of various convoluted pseudo-abstractions that were only introduced to keep up the artificial separation. Change-Id: Iafc3bce625b4794f6d4aa03df6cddc7f2d26716a Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* CppTools: Consider .cu filesChristian Kandeler2020-10-021-0/+3
| | | | | | | | ... when switching via F4 from a .h file and vice versa. Fixes: QTCREATORBUG-24418 Change-Id: I121967dbec90125b3feed0a9d2aceb9826f925f3 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* CppTools: Remove dependency of RawProjectPart to ProjectFileEike Ziller2019-09-031-14/+20
| | | | | | | | | | | | The feature to category files to ProjectFiles was used by the qmake project manager to specify if the file is "active", and by the Qbs project manager to avoid unnecessary MIME type checking. Make these two different use-cases explicit in the API. Change-Id: Ia5a7da37f100149366fc75060fe04687e15f2bd3 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* Clang: Support MSVC style of compiler flagsIvan Donchevskii2019-01-161-0/+36
| | | | | | | | | | | | | Clang has MSVC compatible mode which works with MSVC style command line flags. When possible use the same flags (-I, -D, -U, etc.) and in other cases either replace by MSVC analog (for example use /FI instead of -include) or pass the argument with '/clang:' prefix (requires https://reviews.llvm.org/D53457). Change-Id: I95f33bed5dc8d9493895ed8d4359cdd70fc774b8 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* ClangTools/QMake: Stop analyzing files not part of build configurationNikolai Kosjar2019-01-081-3/+5
| | | | | | | | | | | | | | | ...for the qmake project manager. When parsing the project files, remember whether a file was discovered by the exact or cumulative parse. Only files that were discovered by the exact parse are considered "active" and thus part of the build configuration. The others are not offered for selection. Fixes: QTCREATORBUG-16016 Started-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Change-Id: I7a28b4de15e048975d7f0cd737dd8c11f744315b Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Remove unneeded checks for validity of mime typesEike Ziller2018-06-251-2/+0
| | | | | | | | | | | | mimeTypeForFile(...) is documented to never return an invalid mime type (it will fall back to binary if everything else fails), so remove unneeded checks. This also removes fallback code that used text/plain in case of invalid mime type, which is probably a relict from the old mime implementation. Change-Id: I88ed41fa3b81704f110f9f481b0f01424a487cbb Reviewed-by: David Schulz <david.schulz@qt.io>
* Utils: Wrap MimeDatabase into static functionshjk2017-03-031-2/+1
| | | | | | | | To avoid repeating the 'MimeDatabase mdb; mdb.something(); ' mantra all over the place. Change-Id: I4bfef62e73275a991455141671d6071162788e9d Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* CppTools: Distinguish between ProjectFile::{unclassified,unsupported}Nikolai Kosjar2017-02-021-3/+4
| | | | | | | | | There was no way to determine whether ProjectFile::classify() was run or not. Now, ProjectFile::classify() returns ProjectFile::Unsupported instead of ProjectFile::Unclassified. Change-Id: I660d0e42044bdefcac38058c6f4a3425983a6d93 Reviewed-by: David Schulz <david.schulz@qt.io>
* CppTools: De-duplicate printer of ProjectFile::KindNikolai Kosjar2017-02-021-1/+1
| | | | | Change-Id: I66d2841ac76a73ef7c6548b98438d5c7b3acc4c3 Reviewed-by: David Schulz <david.schulz@qt.io>
* Clang: Add ClangPchManagerMarco Bubke2017-01-301-0/+10
| | | | | | | | | | | | Compiling every header file again and again is quite time comsuming. There are technics to improve this like preambles(a kind of automated precompiled header) but they don't share their data between translation units. This approach provides an automatically generated precompiled header for every project and subproject to improve the loading time. Change-Id: I34f5bd4db21951175920e2a9bbf6b97b1d705969 Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* CppTools: Refactor ProjectPartBuilderNikolai Kosjar2016-12-131-0/+6
| | | | | | | | | | | ...and add some basic tests. Introduce the abstractions ProjectInterface and ToolChainInterface in order to break the dependency to the ProjectExplorer. Also, some simple logic can go there to simplify the (Base)ProjectPartBuilder. Change-Id: I6c50a1804ce62098b87109931eb171f5c2542937 Reviewed-by: David Schulz <david.schulz@qt.io>
* CppTools: Classify ambiguous headers depending on other filesNikolai Kosjar2016-12-121-0/+10
| | | | | | | | | | | | | | This applies for all project managers, except qmake. The qmake project manager will make use of this in follow up changes. Before, "foo.h" was always recognized as a CXXHeader. Now, it depends on the other files. E.g. in a file list {"foo.h", "foo.c"} foo.h is now a CHeader. In {"foo.h", "foo.c", "bar.cpp"} the file "foo.h" is ambiguous and we will create two project parts, one where it is a CHeader, the other where it is a CXXHeader. Change-Id: I50505163368742584b1380c284d42cbe07cb4fc9 Reviewed-by: David Schulz <david.schulz@qt.io>
* CppTools: Clean up ProjectFileNikolai Kosjar2016-12-081-25/+28
| | | | | Change-Id: I01212115566c6bf26268b66fef96d50b7e93b96c Reviewed-by: David Schulz <david.schulz@qt.io>
* Clang: Add clang queryTim Jenssen2016-11-151-5/+0
| | | | | | | | | Clang query is mechanism to use AST matcher to search for code. Think about regular expression but in the context of AST. So you get a semantic search tool for C++. Change-Id: I72e882c5b53a0c52f352a3664847c4c3e4f6fc2e Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* Clang: Classify *.{moc,qdoc} as CXXSourceNikolai Kosjar2016-04-221-0/+4
| | | | | | | | | | This leads to the "-x c++" arguments to libclang for these file types and thus avoids crashes of libclang 3.6. Task-number: QTCREATORBUG-16140 Change-Id: I6141615a1b0b7ad92d7151ad58c304eaf99fb4f3 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
* Update License according to agreement with Free Qt FoundationTobias Hunger2016-01-191-17/+12
| | | | | | | * Update files in src/plugins Change-Id: Ia5d77fad7d19d4bb3498e78661982f68729adb22 Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
* CppTools: Moving ProjectPartBuilder in its own headerMarco Bubke2016-01-131-37/+0
| | | | | Change-Id: I0aa65ec6c80dcd437f13ff70021388b0da57ccfd Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
* CppTools: Move ProjectPart in its own header fileMarco Bubke2016-01-131-1/+1
| | | | | | | | Also extracting inline HeaderPath class and change projects list in vector because the size is larger than a pointer. Change-Id: I885fdff3fe9bccc877634d1615249755f5b674fd Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
* MimeDatabase: Remove bestMatch, which was broken beyond repairEike Ziller2015-02-271-5/+4
| | | | | | | | | | | | The problem is that, if you check e.g. a .pro file against all C/C++ mime types, and these define magic matchers, it would find that .pro doesn't match C/C++ mime types by extension, so it would open the file to find a magic match. Even though the extension .pro would identify it already as a qmake .pro file when checking for the mime type globally. Change-Id: I3341187e88e2263bf38169c3c99e5d2161e2a9ee Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com> Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Use new mime databaseEike Ziller2015-02-171-14/+17
| | | | | Change-Id: I4305872b6b11ef3e8a364280ffa5209a5a793600 Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
* Merge commit '3c85058694ee2e41658d17f524fb48f0b187d2fe'Eike Ziller2015-02-121-6/+6
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/libs/utils/tooltip/tipcontents.cpp src/libs/utils/tooltip/tipcontents.h src/plugins/android/androiddeployqtstep.cpp src/plugins/baremetal/baremetalconstants.h src/plugins/baremetal/baremetaldevice.cpp src/plugins/baremetal/baremetaldevice.h src/plugins/baremetal/baremetaldeviceconfigurationwidget.cpp src/plugins/baremetal/baremetaldeviceconfigurationwidget.h src/plugins/baremetal/baremetaldeviceconfigurationwizard.cpp src/plugins/baremetal/baremetaldeviceconfigurationwizardpages.cpp src/plugins/baremetal/baremetaldeviceconfigurationwizardpages.h src/plugins/baremetal/baremetalplugin.cpp src/plugins/baremetal/baremetalplugin.h src/plugins/baremetal/baremetalruncontrolfactory.cpp src/plugins/baremetal/baremetalruncontrolfactory.h src/plugins/cppeditor/cppcodemodelinspectordialog.cpp src/plugins/cppeditor/cppdoxygen_test.cpp src/plugins/cppeditor/cppdoxygen_test.h src/plugins/debugger/breakpointmarker.cpp src/plugins/debugger/debuggeritemmodel.cpp src/plugins/debugger/debuggeritemmodel.h src/plugins/debugger/loadcoredialog.cpp src/plugins/genericprojectmanager/cppmodelmanagerhelper.cpp src/plugins/projectexplorer/addnewmodel.cpp src/plugins/projectexplorer/addnewmodel.h src/plugins/projectexplorer/jsonwizard/jsonfieldpage.cpp src/plugins/qmlprofiler/abstracttimelinemodel.cpp src/plugins/qmlprofiler/abstracttimelinemodel.h src/plugins/qmlprofiler/notesmodel.cpp src/plugins/qmlprofiler/qml/CategoryLabel.qml src/plugins/qmlprofiler/qml/MainView.qml src/plugins/qmlprofiler/qml/Overview.js src/plugins/qmlprofiler/qml/Overview.qml src/plugins/qmlprofiler/qml/TimeDisplay.qml src/plugins/qmlprofiler/qml/TimeMarks.qml src/plugins/qmlprofiler/qmlprofilertimelinemodelproxy.cpp src/plugins/qmlprofiler/sortedtimelinemodel.cpp src/plugins/qmlprofiler/sortedtimelinemodel.h src/plugins/qmlprofiler/timelinemodelaggregator.cpp src/plugins/qmlprofiler/timelinemodelaggregator.h src/plugins/qmlprofiler/timelinerenderer.cpp src/plugins/qmlprofiler/timelinerenderer.h src/plugins/qmlprojectmanager/QmlProjectManager.json.in src/plugins/texteditor/findinfiles.cpp src/plugins/vcsbase/vcsconfigurationpage.cpp src/shared/qbs src/shared/scriptwrapper/interface_wrap_helpers.h src/shared/scriptwrapper/wrap_helpers.h tests/auto/qmlprofiler/abstracttimelinemodel/tst_abstracttimelinemodel.cpp tests/system/suite_debugger/tst_debug_empty_main/test.py tests/system/suite_debugger/tst_qml_js_console/test.py tests/system/suite_debugger/tst_qml_locals/test.py Change-Id: I67540b648f8b162496f4aa606b04d50c7c9125c6
| * Update LicenseEike Ziller2015-01-161-6/+6
| | | | | | | | | | Change-Id: I711d5fb475ef814a1dc9d2822740e827f3f67125 Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
* | CppTools: Unexport ProjectFileAdderNikolai Kosjar2015-02-091-20/+24
|/ | | | | Change-Id: Icf53019b594a5c45b06f7f1fab0f4bf36e891918 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* License updateEike Ziller2014-10-091-7/+8
| | | | | Change-Id: I3c22ef2685d7aa589f5d0ab74d693653a4c32082 Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
* Incremented year in copyright infoRobert Loehning2014-01-081-1/+1
| | | | | | Change-Id: Ib5423fdd064e4546f848c0b640b0ed0514c26d3a Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com> Reviewed-by: Kai Koehne <kai.koehne@digia.com>
* Apply 'static' pattern to MimeDatabasehjk2013-09-031-4/+2
| | | | | | | | Also adjust and streamline using and surrounding code. Change-Id: I6a8b05126bdcbb74ff611b21c7cb3c5902a2d5ca Reviewed-by: Tobias Hunger <tobias.hunger@digia.com> Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Introduced mime-type for ObjC++.Erik Verbruggen2013-07-181-0/+3
| | | | | | | | | Updated/fixed the code to treat treat text/x-objcsrc and text/x-objc++src correctly. Change-Id: I1ab97577c786a28381398e4e0fac177325d00d7b Reviewed-by: Sergey Shambir <sergey.shambir.auto@gmail.com> Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* CppTools: moved some logic to ProjectFileSergey Shambir2013-04-101-0/+52
| | | | | | | Simplifies code and makes it independent from mimetype names. Change-Id: Ib56a07654df4986b1916c517e3862e6c3a3dd720 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* CppTools: Use namespace CppTools consistentlyTobias Hunger2013-04-081-13/+13
| | | | | | | | | There were quite a few classes using CPlusPlus namespace in the CppTools plugin. Rename them and do some other small namespace related coding style fixups. Change-Id: I093fc1f3fc394fd9923e3f18d5f66522e288f21d Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* fix include style relating to cplusplus librariesOswald Buddenhagen2013-04-031-1/+4
| | | | | | | | | | | ... and adjust INCLUDEPATH accordingly. while i'm at messing with include statements, also re-order the include blocks according to policy and sort them within bigger blocks. Change-Id: I7762abfd7c4ecf59432b99db2f424e4fa25733a5 Reviewed-by: Tobias Hunger <tobias.hunger@digia.com> Reviewed-by: Eike Ziller <eike.ziller@digia.com>
* CppTools: fixed bugs in change 49602Sergey Shambir2013-03-271-2/+2
| | | | | Change-Id: I14e9bbfea1bca58cdc49212b7ad1d880ab908ec8 Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
* CppTools: Fix build with namespaced Qt.Christian Kandeler2013-03-251-3/+3
| | | | | Change-Id: Idec32131c20b91c3d08ac16fbcc1c14ee5ede450 Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
* CppTools: improved languages support in ProjectPartSergey Shambir2013-03-211-0/+101
Please, read blueprint here: http://qt-project.org/wiki/Blueprint-for-language-specs-system Removed feature from QbsProjectManager: it not longer splits project on separate C and C++ parts, because Qt version used only by clang parser (not native) and can be ignored for pure C and Objective-C without C++. Change-Id: I1c561f7f9f915cc6cb8579d19db74e8352f54c1e Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com> Reviewed-by: Tobias Hunger <tobias.hunger@digia.com> Reviewed-by: Daniel Teske <daniel.teske@digia.com>