summaryrefslogtreecommitdiff
path: root/src/plugins/cpptools/cppsourceprocessor.h
Commit message (Collapse)AuthorAgeFilesLines
* Merge CppTools into CppEditorChristian Kandeler2021-09-011-131/+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>
* Standardize on int for line and column valueshjk2019-07-261-11/+11
| | | | | | | | | | | | | | | Recently tons of warnings show up for presumably "problematic" singned <-> unsigned and size conversions. The Qt side uses 'int', and that's the biggest 'integration surface' for us, so instead of establishing some internal boundary between signed and unsigned areas, push that boundary out of creator core code, and use 'int' everywhere. Because it reduces friction further, also do it in libcplusplus. Change-Id: I84f3b79852c8029713e7ea6f133ffb9ef7030a70 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* CppTools: modernizeAlessandro Portale2019-01-211-2/+2
| | | | | | Change-Id: Iaf02e4d026f1ac8b216833d83cd7a735e21ff60a Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io> Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Add system include path to HeaderPath and merge ProjectPartHeaderPathMarco Bubke2018-09-101-4/+4
| | | | | | | | | | | | | System include paths are appended after other includes by the compiler. So we should set them as system includes and not as normal includes. Otherwise we change the include order. Headers in system include paths are not cluttering the screen with unwanted warning and by the way improve performance too. ProjectPartHeaderPath was a dopperganger of HeaderPath, so we merged them. Change-Id: I7c394b4098b697de79761499ffcd5913cc02d652 Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* CppTools: Add UI for file size limit of indexerNikolai Kosjar2016-08-311-0/+2
| | | | | | | Task-number: QTCREATORBUG-16712 Change-Id: I92db8cbcac9669cbd5e4ee5f7ef6f613797c753a Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* CppTools: Cancel parsing if editor is closedNikolai Kosjar2016-07-291-0/+3
| | | | | | | | | | | | The m_parserFuture.cancel() in ~BuiltinEditorDocumentProcessor() did not cancel anything. Thus, closing a document while the parser was running led to a blocking UI thread. Now it cancels at the next include directive it encounters. Change-Id: I092fddbbd747e0bc95265b6e9b4fcc26b3f76cb3 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* CppTools: Fix include filename cache logicFinn Brudal2016-05-241-1/+2
| | | | | | | | | | | When resolution of a local include fails, a global resolution must be done. When doing so, re-use the cache. This will speed up the resolution for projects that mainly use the local include directives also for global headers. Change-Id: I7488c1977a44b881f90faa863d22f6276c20b147 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* Wholesale conversion to #pragma oncehjk2016-03-301-4/+1
| | | | | | | Kudos to cgmb and https://github.com/cgmb/guardonce Change-Id: Ifa8970734b8d43fd08c9260c645bdb0228633791 Reviewed-by: Tobias Hunger <tobias.hunger@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: Move ProjectPart in its own header fileMarco Bubke2016-01-131-3/+3
| | | | | | | | 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>
* cpptools: s/Q_DECL_OVERRIDE/override/gTobias Hunger2015-06-041-10/+10
| | | | | Change-Id: I1b239a666b6605035e0f9c140d940e8c260bafd3 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
* CppTools: Remove separate indexing revisionNikolai Kosjar2015-04-241-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | For indexing we used a custom revision that was updated on each modelManager BuiltinIndexingSupport::refreshSourceFiles() call. This could lead to rejection of updated documents triggered by refactoring actions, like for the following case: 1. Open a project containing a.h and a.cpp 2. Open a.cpp, insert some new lines, save and close the document 3. Open a.h and rename a function that is defined in a.cpp --> The refactoring action modifies a.h and a.cpp, so re-indexing of those is triggered. Since a.cpp has already a higher revision (step 2) than the updated document, the updated document is discarded. As a consequence find usages and follow symbol fails for the renamed function. Now the document call back provided to CppSourceProcessor is responsible for updating the document revision based on the latest revision in the global snapshot. Change-Id: I4dfa0a4d34991655acfa749109f00c47b0fbfdbe Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com> Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
* C++: Use correct features for document parsingOrgad Shaneh2015-02-201-0/+2
| | | | | | Task-number: QTCREATORBUG-8007 Change-Id: Ic96aaa433442812a99bac9d16bb9124d66762e8c Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
* Update LicenseEike Ziller2015-01-161-6/+6
| | | | | Change-Id: I711d5fb475ef814a1dc9d2822740e827f3f67125 Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
* CppTools: Make use of QLoggingCategoryNikolai Kosjar2014-11-031-4/+0
| | | | | | | ...for document processing and highlighting. Change-Id: I31d42a5a5010260643ec76688080fd14a486f7e3 Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
* License update.Eike Ziller2014-10-151-7/+8
| | | | | Change-Id: I0acde2c3b995693de682679471f03af85bdd0a61 Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
* Use Q_DECL_OVERRIDE instead of QTC_OVERRIDEThomas Hartmann2014-09-251-11/+10
| | | | | | | | | This patch removes src/libs/utils/qtcoverride.h and uses Q_DECL_OVERRIDE from Qt 5 instead. Change-Id: I61ffa539648ffe996dc061eec7708c04580c0f09 Reviewed-by: Eike Ziller <eike.ziller@digia.com> Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
* CppTools: Change CppModelManager implementation patternhjk2014-09-191-1/+1
| | | | | | | | | Replace the CppModelManagerInterface/derived CppModelManager combo by a more common CppModelManager/CppModelManagerPrivate pimpl pattern. Change-Id: Ia4582845ed94d5ef60b8571bab9b2260c6290287 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* C++: Change QStringList to QSet<QString> to prevent conversions.Erik Verbruggen2014-09-041-1/+1
| | | | | | | | | This eliminates a bunch of list->set->list conversions. Especially the ProjectInfo::appendProjectPart takes lots of time converting for every part added. Change-Id: Ib3c8cd4b0ad6c012ccbeed12ebedd46b9b6cca95 Reviewed-by: Daniel Teske <daniel.teske@digia.com>
* Add copyright commentNikolai Kosjar2014-08-221-0/+29
| | | | | Change-Id: Ia16f38f4823a0d740391ef4450b858d10f3184e5 Reviewed-by: hjk <hjk121@nokiamail.com>
* CppTools: Move WorkingCopy to new cppworkingcopy.{h,cpp}Nikolai Kosjar2014-08-201-2/+3
| | | | | Change-Id: I447acf28849bffb52c1e6b6eafdde221ec0b179e Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* CppTools: Auto-include pre-compiled headersNikolai Kosjar2014-07-241-2/+3
| | | | | | | | | | | | So far the pre-compiled headers were processed (thus defines from those headers were visible), but the actual includes for the documents were not added, which is necessary for lookup/completion. Note that this will be only done if pre-compiled headers are not ignored (Options > C++ > Code Model > [] Ignore pre-compiled headers). Change-Id: I54a8e6b00597af164d958e3e9f2a1075ea187788 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* C++: fix include/framework path handling.Erik Verbruggen2014-07-041-5/+3
| | | | | | | | | | Instead of having two lists of paths, now only one list is used where both include paths and framework paths can be mixed. This reflects the way the compiler is invoked, and retains the (correct) search order. Task-number: QTCREATORBUG-11599 Change-Id: I373953e3e305df5b7a0d10920e12d146584adf9f Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* Utils: Remove function wrapperhjk2014-06-301-1/+2
| | | | | | | | | This was an intentional, time-limited workaround that has served its purpose now that we require C++11. Change-Id: I96ece9c21bd405d281fd381bd9b87edc00c5ee84 Reviewed-by: Daniel Teske <daniel.teske@digia.com> Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
* C++: move post-sourceprocessing action into callback.Erik Verbruggen2014-06-181-8/+9
| | | | | Change-Id: Iac6c9fe1ada27ac0d96417e490cc5723e6969541 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* CppTools: Unexport some internal classes.Nikolai Kosjar2014-06-101-1/+1
| | | | | | | | | | | | | | | | Unexports CppModelManager, CppSourceProcessor and CppToolsPlugin. Now only some constructor signatures mention "Internal::" in the exported symbols: % nm --extern-only --demangle ./lib/qtcreator/plugins/libCppTools.so | grep "Internal::" CppTools::CppClassesFilter::CppClassesFilter(CppTools::Internal::CppLocatorData*) CppTools::CppClassesFilter::CppClassesFilter(CppTools::Internal::CppLocatorData*) CppTools::CppEditorSupport::CppEditorSupport(CppTools::Internal::CppModelManager*, TextEditor::BaseTextEditor*) CppTools::CppEditorSupport::CppEditorSupport(CppTools::Internal::CppModelManager*, TextEditor::BaseTextEditor*) Change-Id: I167c21a6dc03cf02230c95fde66cf404e40df36f Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* CppTools: Clean up CppSourceProcessorNikolai Kosjar2014-06-041-31/+28
| | | | | | | This mostly makes sourceNeeded() a bit more readable. Change-Id: I8da40090fb499837ec56276e7a4273211920c2d2 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* CppTools: Rename CppPreprocessor to CppSourceProcessorNikolai Kosjar2014-06-041-0/+109
...since it does quite a bit more than only preprocessing, as the name suggests. We use that class to process source files in general. The output is not a preprocessed source, but a set of CPlusPlus::Documents with symbols. Change-Id: I787d0f22f9f042ddf0c99e8c2f0bdb9aa7001735 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>