Commit Graph

15 Commits

Author SHA1 Message Date
Nikolai Kosjar
a7928b4b0b Clang: Integrate clang's fixits as refactoring actions
They are invokable by the usual means (Alt+Enter, editor's context menu
> Refactor) plus by the context menu of the editor's left margin for the
related line.

The fixit text comes directly from libclang and is thus not translated.
We modify the text slighty by stripping the diagnostic category prefix
("note:", "error:", ...) and capitalizing the first letter.

A follow-up change should properly indicate available refactorings with
a refactoring icon in the editor's left margin.

Task-number: QTCREATORBUG-14868
Change-Id: I86157c9f824d2a9dedf19087476d02ad1e6cc854
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
2015-09-29 11:39:21 +00:00
Nikolai Kosjar
169556db2f C++: Fix crash after triggering completion and closing editor
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>
2015-09-02 12:37:23 +00:00
Nikolai Kosjar
418fc32f6a Clang: Do not call DocumentManager::modifiedDocuments() from worker thread
This is unsafe.

Change-Id: I8ac075a7289afa0d84785e37b1325d186a153000
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
2015-07-10 14:04:19 +00:00
Nikolai Kosjar
cb61a8a9aa CppTools: Remove some pointless declarations
* 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>
2015-07-08 13:25:13 +00:00
Nikolai Kosjar
e50aafafe3 CppEditor: Fix semantic highlighting when zooming
...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>
2015-06-23 08:15:46 +00:00
Nikolai Kosjar
5e035bd740 C++: Rename semanticRehighlight to recalculateSemanticInfoDetached
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>
2015-06-22 07:20:21 +00:00
Friedemann Kleint
fe2addf515 Clean exported headers of the TextEditor plugin.
Change-Id: I1e7dd34ba5a51fb0b34d137dc03add4457b32ed1
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2015-02-26 13:15:29 +00:00
Eike Ziller
9926fc2ab1 Merge commit '3c85058694ee2e41658d17f524fb48f0b187d2fe'
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
2015-02-12 17:29:21 +01:00
Eike Ziller
3c85058694 Update License
Change-Id: I711d5fb475ef814a1dc9d2822740e827f3f67125
Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
2015-01-16 12:37:56 +01:00
Orgad Shaneh
c6a983d271 Core: Use FileName for file path in IDocument
Change-Id: I85f7398aee59d0d36f0e5c3bf88ff3c96002e394
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2015-01-12 10:23:37 +01:00
Nikolai Kosjar
9ccb6b81c9 CppTools: Fix include hierarchy for clang code model
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>
2014-11-28 14:20:29 +01:00
Eike Ziller
9c7019f0b2 License update.
Change-Id: I0acde2c3b995693de682679471f03af85bdd0a61
Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
2014-10-15 15:19:55 +02:00
hjk
953cdb971f TextEditor: More BaseText* -> Text* renamings
*Document* and *Layout* classes, all basetext* files

Change-Id: I1c6e376733a434fcb5c7f19c6210dfa031eeafde
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2014-09-26 10:12:51 +02:00
hjk
0fcca946ad Rename {Core,TextEditor},{Base,}TextDocument classes
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>
2014-09-25 18:00:51 +02:00
Nikolai Kosjar
89bd4ee3c4 C++: Base parsing on editor document instead of widget
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>
2014-08-25 13:06:01 +02:00