summaryrefslogtreecommitdiff
path: root/src/plugins/cpptools/cppprojectpartchooser.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Merge CppTools into CppEditorChristian Kandeler2021-09-011-190/+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: Use only const pointers for ProjectInfo and ProjectPartChristian Kandeler2021-08-271-7/+7
| | | | | | | | All members were already const, but this makes it clear at all points of use that these data structures are immutable. Change-Id: Iea615c090bde462c445d15223caccc561b0c713d Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* CppTools: Turn some classes into pure value typesChristian Kandeler2021-08-131-1/+1
| | | | | | | | | | | | | ProjectInfo, ProjectPart and ProjectUpdateInfo used to carry pointers to Project and/or Toolchain, even though they were used in contexts where these pointers were either unsafe to access or not guaranteed to be valid anymore, which made their use difficult and error-prone. We turn these classes into pure value types by copying in all relevant information before the first async operation takes place. Fixes: QTCREATORBUG-25678 Change-Id: I1914b0dbda6c7dfba6c95e5e92f2d69977755590 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* CppTools: modernizeAlessandro Portale2019-01-211-1/+1
| | | | | | Change-Id: Iaf02e4d026f1ac8b216833d83cd7a735e21ff60a Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io> Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Utils: Move C++ language details from ProjectExplorer to UtilsMarco Bubke2019-01-151-1/+1
| | | | | | | | We want to use them in the backend processes too so it's nice to share them in Utils. A concrete size was added too because they should be serialized. Change-Id: Id5eb8f46643d5159f034fc9559f68a08d7e5847a Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* CppTools/ProjectExplorer: Remove enum duplicationNikolai Kosjar2018-10-081-1/+2
| | | | | | | | ... between CppTools::ProjectPart and ProjectExplorer::ToolChain. Change-Id: I8b448747e454adbed77547460383b8515462cc81 Reviewed-by: Tobias Hunger <tobias.hunger@qt.io> Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
* CppEditor: Rework showing/switching parse configurationsNikolai Kosjar2017-02-031-46/+38
| | | | | | | | | | | | | | | | | | | | | | * Move the combox box for switching the parse configurations out of the "Additional Preprocessor Directives" dialog ('#'-button) to make it better visible/accessible. Also, decouple the extra preprocessor directives from the concrete parse context since this is not anymore in same dialog. * The combo box appears only if multiple parse configurations are available for a file. * The first time multiple parse configurations are detected, an info bar is shown that points the user to the combox box. A "Do Not Show Again" button is provided. * Upon selecting an entry, the preferred parse configuration is saved as part of the session. The setting can be cleared with the context menu entry on the combo box. Follow-up changes need to ensure that the display name and/or tooltip is unambiguous, e.g. for qbs and cmake projects. Change-Id: I9e9773704187291524ad7b605bfdddd83ef5b19d Reviewed-by: David Schulz <david.schulz@qt.io>
* CppTools: Fix choosing project part after project openNikolai Kosjar2017-01-261-13/+13
| | | | | | | | | As long as there are project parts for a source file, always determine the best project part, instead of trying to stick to the previous one. This ensures the best project part at all times and simplifies the code. Change-Id: I25ea3eb43a5a3e6d93688d4b8965f596dc9ae22b Reviewed-by: David Schulz <david.schulz@qt.io>
* CppTools: Fix using updated project partNikolai Kosjar2017-01-261-8/+16
| | | | | | | | | | | | | | | 1. Open a project consisting of two subprojects referencing the same source file. 2. Open the source file. 3. Click '#' in the editor toolbar and select the second project (part). 4. Update the project file, e.g. add a define ==> Editor does not reflect the added define This is due to comparing project part pointers. Fix by using the project part id that remains stable across project manager updates. Change-Id: Ifd1a113e55ebe2ecf036cd7caafdbfd6e4cdf415 Reviewed-by: David Schulz <david.schulz@qt.io>
* CppTools: Use fallback project part if project is closedNikolai Kosjar2017-01-261-7/+5
| | | | | | | | | ...instead of sticking to the old one. If a project is closed, the editor should reflect that. It also simplifies the code. Change-Id: I9b8a94513d3b06a238cfc4ee60c11c0d0da3d93f Reviewed-by: David Schulz <david.schulz@qt.io>
* CppTools: Provide hints about chosen project part for editor documentNikolai Kosjar2017-01-241-45/+107
| | | | | | | | | | | | Parse issues can have multiple reasons (invalid kit, not a project file, actual parse issue) and we should be able to tell them apart. With this change, we can distinguish between the fallback project part and a ambiguous project part. Follow up changes will use this to display more accurate diagnostics. Change-Id: Icc8767607cc17dc14d6227b07f34e81ba5525a96 Reviewed-by: David Schulz <david.schulz@qt.io>
* CppTools: Allow interpreting ambiguous headers as C headersNikolai Kosjar2017-01-161-7/+22
| | | | | | | | | | | | | | ...instead of C++ headers. For the Clang Code Model this results in using "-x c-header" instead of "-x c++-header". This introduces a new option in Options > C++ > "Code Model" to configure this. Change-Id: I8a0ce8fa6155f5ef58743ebc7f1d0b500fbf6599 Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* CppTools: Prioritize project parts with selectedForBuilding=trueNikolai Kosjar2016-12-191-7/+24
| | | | | | | | | ...when selecting one for the editor document. This flag is only set by the QmakeProject. Change-Id: I648886e12148bd1ebeccca52d9faaf4b528597c9 Reviewed-by: David Schulz <david.schulz@qt.io>
* CppTools: Reparse editor documents after active project changeNikolai Kosjar2016-12-161-3/+3
| | | | | Change-Id: I010709c866291bf59c27f4a05765e1ab0efd28af Reviewed-by: David Schulz <david.schulz@qt.io>
* CppTools: Prioritize project parts from active projectNikolai Kosjar2016-12-161-3/+13
| | | | | | | ...when selecting one for the editor document. Change-Id: I85066aaa0862870cb2db2fb2cb40c2b2c23b2cac Reviewed-by: David Schulz <david.schulz@qt.io>
* CppTools: Extract ProjectPartChooserNikolai Kosjar2016-12-161-0/+87
...and put it under tests. Change-Id: Id4bd2391abd1dfdc23640e871453558566cb0693 Reviewed-by: David Schulz <david.schulz@qt.io>