Commit Graph

24 Commits

Author SHA1 Message Date
Nikolai Kosjar
8309e0c56a Clang: Avoid blocking UI if references are requested and clangbackend crashes
The two cases in which the UI might be blocked are:
 * Invocation of the editor context menu
 * Rename Symbol Under Cursor

Cancel the future if the backend is restarted and on the other side,
check whether the future is cancelled.

Change-Id: If2315da1f66f15eab1531fcd8da1dff851a9a4e6
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-07-17 08:24:08 +00:00
Nikolai Kosjar
7a09bb4418 TextEditor: Reduce BaseHoverHandler::identifyMatch() calls
...because they are potentially expensive.

Change-Id: Iaa235ea1fa864a0a67f3ed10b7f89d23179c642b
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-06-30 08:58:07 +00:00
Nikolai Kosjar
d870bab95c CppEditor: Cancel runner in ~CppUseSelectionsUpdater
...otherwise an already destructed QTextDocument might be accessed in
the ClangCodeModel::Internal::IpcReceiver::references.

Task-number: QTCREATORBUG-18459
Change-Id: I1868b2fd3a64341794f83eea6c4eeb7c2c1af812
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-06-28 12:35:09 +00:00
Nikolai Kosjar
ca72c29462 Clang: Provide highlighting for identifier under cursor
Change-Id: I80ffe23cbcc84ab7323124581d9dd6afbe974fd0
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2017-06-14 12:49:05 +00:00
Nikolai Kosjar
9de9da7423 CppEditor: Do not start CppUseSelectionsUpdater for same identifier
Saves some cycles when navigating with the text cursor over the
characters.

Change-Id: Ie9a23d97ac09ca45a32178cae5b8945d0c623811
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2017-06-14 12:35:26 +00:00
Nikolai Kosjar
fdf0a104ec CppEditor: Generalize CppUseSelectionsUpdater
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>
2017-06-14 12:24:59 +00:00
Nikolai Kosjar
39dea09794 CppEditor: Fix uninitialized value warnings
...from coverity scan.

Change-Id: I1b1fb919e77f1407fe2e4319392c28413a296493
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
2017-06-01 13:33:21 +00:00
Nikolai Kosjar
6174cca5a0 Move CanonicalSymbol from CppEditor to CppTools
Needed for a follow-up change.

Change-Id: Ibb4815f3411f0d63deac8c32583178470668f67b
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2017-05-29 06:42:09 +00:00
Orgad Shaneh
928ba8aa84 CppEditor: Use Qt5-style connects
The heavy lifting was done by clazy.

Change-Id: I5ee3678f8293486cccfc634aaab5c75b066ed011
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2016-05-30 06:51:08 +00:00
Eike Ziller
6e5d4b892e CppTools/Editor: Use Utils::runAsync
Change-Id: Ifcc2a34e3478eb84f95221b79e39f7a670e6b2e0
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2016-02-15 12:14:21 +00:00
Tobias Hunger
397e7f4843 Update License according to agreement with Free Qt Foundation
* Update files in src/plugins

Change-Id: Ia5d77fad7d19d4bb3498e78661982f68729adb22
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-01-19 15:57:01 +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
Orgad Shaneh
65e7db42b8 C++: Remove unneeded qualifications
Mostly done using the following ruby script:
Dir.glob('**/*.cpp').each { |file|
  next if file =~ %r{src/shared/qbs|/qmljs/}
  s = File.read(file)
  s.scan(/^using namespace (.*);$/) {
    ns = $1
    t = s.gsub(/^(.*)\b#{ns}::((?!Const)[A-Z])/) { |m|
      before = $1
      char = $2
      if before =~ /"|\/\/|\\|using|SIGNAL|SLOT|Q_/
        m
      else
        before + char
      end
    }
    if t != s
      puts file
      File.open(file, 'w').write(t)
    end
  }
}

Change-Id: I6fbe13ddc1485efe95c3156097bf41d90c0febac
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-02-04 15:27:22 +00: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
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
10c8d5f0ca TextEditor: Rename BaseTextEditorWidget to TextEditorWidget
... and some of the related implementation details

Change-Id: I1f03aa5acf2d3fb2cfc2a6a7845f3d3578b0408d
Reviewed-by: David Schulz <david.schulz@digia.com>
2014-09-29 14:54:32 +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
b26a17f30d CppTools: Change CppModelManager implementation pattern
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>
2014-09-19 13:17:55 +02:00
Nikolai Kosjar
9e81bd0b36 CppEditor: Clean up CppUseSelectionsUpdater
* Remove unused member m_snapshot
* QTC_CHECK -> "if (!...)" - the revision might have changed in the mean
  time
* Restore previous document in synchronous case

Change-Id: Ie05c044fbb75e92edbf0fdb041178aadde8113c5
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
2014-09-08 11:55:15 +02:00
Erik Verbruggen
bf33b41da8 C++: set the document field in the synchronous case.
Task-number: QTCREATORBUG-12975
Change-Id: I9a4b8c69e925e288b7b02263c27f9791748bac85
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2014-09-08 10:10:13 +02:00
Nikolai Kosjar
a29539f9c5 CppEditor: Compare semantic info revision in CppUseSelectionsUpdater
...instead of the semantic info *document* revision, which might be
older in case the semantic info was re-used.

This fixes the use selections in case the user triggered the undo action
after some changes in the local renaming mode.

Regression introduced by extraction of the CppUseSelectionsUpdater in

    commit 89bd4ee
    C++: Base parsing on editor document instead of widget

Change-Id: I8f38f6b53c950e25f02675a939876fa3ed0e81f4
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2014-08-29 16:04:56 +02:00
Nikolai Kosjar
7bfe231897 CppEditor: Make local renaming more robust again
This will update the use selections synchronously again in case the user
triggered "Rename Symbol Under Cursor", just as before

    commit 89bd4ee
    C++: Base parsing on editor document instead of widget

Change-Id: I8d4d3dcc7140a61f9ac611a505db09dc96a17740
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2014-08-29 16:04:48 +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