summaryrefslogtreecommitdiff
path: root/src/plugins/cpptools/builtineditordocumentprocessor.h
Commit message (Collapse)AuthorAgeFilesLines
* Merge CppTools into CppEditorChristian Kandeler2021-09-011-78/+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 override consistentlyTobias Hunger2018-05-071-1/+1
| | | | | | | clang-tidy fixes from modernize-use-override check. Change-Id: I0e6d6a9df3e87b8042ccc5ea0adc70070a3821d6 Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
* Clang: use local renaming based on ClangCodeModelIvan Donchevskii2017-11-201-2/+2
| | | | | | | | Provide refactoring engine for ClangCodeModel and implement missing methods. Change-Id: If5c913e0c5a7941cd2ced54d0fcfa4d625eadc93 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* Clang: use HighlightingMarks for hover with Ctrl highlightingIvan Donchevskii2017-09-221-1/+1
| | | | | | | | | | Make this highlighting work without builtin code model but based on the HighlightingMarks that we already have from ClangCodeModel. Redundant parameters are removed by this change. Change-Id: I73b5dab46ba59d2f813236831818f0a9bc94c5bc Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* Clang: implement requestFollowSymbol plug-in sideIvan Donchevskii2017-08-151-0/+2
| | | | | | | | | Invoke follow symbol in clang backend if env variable QTC_CLANG_FOLLOW_SYMBOL is 1. Does not include backend implementation. Change-Id: Ia20a677830ebdd7f24800af5c5d6e8b1bf579205 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* CppEditor: Generalize CppUseSelectionsUpdaterNikolai Kosjar2017-06-141-0/+2
| | | | | | | | | Let CppUseSelectionsUpdater delegate the work to *EditorDocumentProcessor so that the clang code model can also provide results. Change-Id: I6872afbfeea1a5c4a64fdf19fcb1992f134dde08 Reviewed-by: Marco Bubke <marco.bubke@qt.io>
* CppTools: Remove some duplicationNikolai Kosjar2016-12-161-1/+1
| | | | | Change-Id: I8c84660b28c3e76b2cedd08ff3b44a38583f38a0 Reviewed-by: David Schulz <david.schulz@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>
* C++: Fix crash after triggering completion and closing editorNikolai Kosjar2015-09-021-2/+2
| | | | | | | | | | | | | | | | | | | | | Fix use-after-free for the following case: 1. Open an editor 2. Trigger a long processing completion (e.g. simulate with QThread::msleep in CppCompletionAssistInterface::getCppSpecifics) 3. ...and immediately close the editor (e.g. with Ctrl+W) 4. Wait until it crashes. The completion thread relied on the BuiltinEditorDocumentParser object, which is deleted once the editor is closed. Fixed by sharing the ownership of that object between the *EditorDocumentProcessor and the completion assist interface. This case came up when doing tests for the bug report below. Task-number: QTCREATORBUG-14991 Change-Id: I0b009229e68fc6b7838740858cdc41a32403fe6f Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
* CppTools: Remove some pointless declarationsNikolai Kosjar2015-07-081-1/+0
| | | | | | | | * Unneeded private declared constructors * Q_DISABLE_COPY for classes deriving from QObject (not copyable) Change-Id: I89669e8bb062cda16bab5812e2ac591f9dcf4af2 Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
* CppEditor: Fix semantic highlighting when zoomingNikolai Kosjar2015-06-231-0/+1
| | | | | | | | | | | | ...for the not visible documents. First reset the extra additional formats, then set the new ones, not the other way around. Task-number: QTCREATORBUG-14579 Change-Id: Iae465bd9a7bb0a397fd4917df45955713aaf87c5 Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
* C++: Rename semanticRehighlight to recalculateSemanticInfoDetachedNikolai Kosjar2015-06-221-1/+1
| | | | | | | | semanticRehighlight() does a bit more than only rehighlighting and we want to trigger (only) rehighlighting in a follow-up change. Change-Id: Ic8da9ec8643f0f82f7c99ef9a8180b2868194254 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* cpptools: s/Q_DECL_OVERRIDE/override/gTobias Hunger2015-06-041-6/+6
| | | | | Change-Id: I1b239a666b6605035e0f9c140d940e8c260bafd3 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: Fix include hierarchy for clang code modelNikolai Kosjar2014-11-281-1/+1
| | | | | | | | | | 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>
* CppTools: restore C++ diagnostics messages.Francois Ferrand2014-10-231-0/+4
| | | | | | | The messages were computed, but not added to the document. Change-Id: Ibeea802cf9f291ad14b2fe2e9d2a285c927a4449 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
* License update.Eike Ziller2014-10-151-7/+8
| | | | | Change-Id: I0acde2c3b995693de682679471f03af85bdd0a61 Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
* Rename {Core,TextEditor},{Base,}TextDocument classeshjk2014-09-251-1/+1
| | | | | | | | | First step of some more 'Base' removal in TextEditor. s/Core::TextDocument/Core::BaseTextDocument/ s/TextEditor::BaseTextDocument/TextEditor::TextDocument/ Change-Id: I71ba325a2f0ad72ec9dae0d96846cbae72d326f7 Reviewed-by: hjk <hjk121@nokiamail.com>
* Use Q_DECL_OVERRIDE instead of QTC_OVERRIDEThomas Hartmann2014-09-251-6/+5
| | | | | | | | | 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/Clang: Remove QScopedPointers in *EditorDocumentParsersNikolai Kosjar2014-08-291-4/+1
| | | | | | | ...since they are pointless. Change-Id: I1c7925d3b1ad33ac0f1dc372797e3ab9a4bdc4b3 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* CppTools: Provide the editor snapshot for SemanticInfoUpdaterNikolai Kosjar2014-08-291-1/+3
| | | | | | | | | ...so that SemanticInfoUpdater does not depend anymore on the EditorDocumentParser. Accessing the snapshot was a blocking operation that delayed the semantic info update longer than actually needed. Change-Id: I348d22ef83ab310d4319b2e8b9678fe90ee24d6a Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* CppTools: De-slot some private document processor functionshjk2014-08-291-2/+1
| | | | | Change-Id: Ia91b4262d9dad60492f9175e453c950473689a8a Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* C++: Base parsing on editor document instead of widgetNikolai Kosjar2014-08-251-0/+80
This mainly takes CppEditorSupport apart. * Parsing is now invoked by CPPEditorDocument itself by listening to QTextDocument::contentsChanged(). * Upon construction and destruction CPPEditorDocument creates and deletes an EditorDocumentHandle for (un)registration in the model manager. This handle provides everything to generate the working copy and to access the editor document processor. * A CPPEditorDocument owns a BaseEditorDocumentProcessor instance that controls parsing, semantic info recalculation and the semantic highlighting for the document. This is more or less what is left from CppEditorSupport and can be considered as the backend of a CPPEditorDocument. CPPEditorDocument itself is quite small. * BuiltinEditorDocumentProcessor and ClangEditorDocumentProcessor derive from BaseEditorDocumentProcessor and implement the gaps. * Since the semantic info calculation was bound to the widget, it also calculated the local uses, which depend on the cursor position. This calculation got moved into the extracted class UseSeletionsUpdater in the cppeditor plugin, which is run once the cursor position changes or the semantic info document is updated. * Some more logic got extracted: - SemanticInfoUpdater (logic was in CppEditorSupport) - SemanticHighlighter (logic was in CppEditorSupport) * The *Parser and *Processor classes can be easily accessed by the static function get(). * CppHighlightingSupport is gone since it turned out to be useless. * The editor dependency in CompletionAssistProviders is gone since we actually only need the file path now. Change-Id: I49d3a7bd138c5ed9620123e34480772535156508 Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>