Commit Graph

170 Commits

Author SHA1 Message Date
Nikolai Kosjar
420bc69739 CppTools: Use project part ids instead of file paths
File paths are not unique since e.g. each qbs group in a file is mapped
to a project part.

Change-Id: I7df3f224dd23046b869f2588b8a34eb26cfc0b1a
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
2015-07-20 09:49:14 +00:00
Nikolai Kosjar
0369bac126 UiCodeModelSupport: Notify if content changes
Needed for ClangCodeModel.

If the content changes, we want to send it immediately to the
codemodelbackend process.

Change-Id: Iedf16930b494ccb5e91f1bc435db026067d98613
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>
2015-07-08 15:38:16 +00:00
Nikolai Kosjar
23b8a3b2e8 Clang: Use completion through backend process
This makes us independent of libclang crashes for completion.
Re-parsing for highlighting still happens in the Qt Creator process.

Run in verbose mode:
    qtc.clangcodemodel.ipc=true

Run tests:
    -test "ClangCodeModel"

Task-number: QTCREATORBUG-14108
Task-number: QTCREATORBUG-12819
Change-Id: Id3e95bd2afdb6508bbd1d35fddc69534a909b905
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
2015-06-10 10:15:40 +00:00
Nikolai Kosjar
9425812066 CppTools: Export ModelManagerTestHelper
Needed for tests in ClangCodeModel.

Change-Id: I58bdb35811776751a95b5db198ea8d6cdb0cd6de
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
2015-06-03 09:15:36 +00:00
Friedemann Kleint
fb80206f3c Clean exported headers of the CppTools plugin.
Change-Id: I0144ac33e88980c431c54a6d69bbde28da4b1967
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2015-03-05 08:16:48 +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
Nikolai Kosjar
d8d03ad607 CppTools: Remove virtualness
Change-Id: I1ea9f755fe0fc7053e2fb209de9301bcb1a81739
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2015-02-09 11:20:31 +00:00
hjk
2d81c18028 Test compile fix after 063251eb
Change-Id: I3bf9d65b73a4ab1619c8e48815792f35e2359f45
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-01-30 12:05: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
Nikolai Kosjar
4d3d0e0290 CppTools: Rename EditorDocumentHandle to CppEditorDocumentHandle
...and related functions. For clarity in client code.

Change-Id: Icad6fc7b1eee2ce46a2eba8435359837a23409c8
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
2015-01-14 12:33:15 +01:00
Erik Verbruggen
7d377850d0 C++: handle case-insensitive file names for project files.
... by keying on Utils::FileName.

Task-number: QTCREATORBUG-12390
Change-Id: Ib99eefcf3440d4383f624a614a3093f427efffbd
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2014-12-18 11:54:12 +01:00
Nikolai Kosjar
cb0d136926 CppTools: Update document on activation
...if the project was updated in the meanwhile.

If a project is updated mark invisible editor documents dirty and update
them if they get focus.

This also fixes document highlighting when restoring a session for
documents that the user "switched away" before the project info is
pushed to CppModelManager.

This completes

    CppTools: Update visible documents on project update
    commit c2eb91e053

which only takes care of visible documents.

Task-number: QTCREATORBUG-13270
Change-Id: Id445e7f509deac5d03194aecc54ce4629b7926ce
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
2014-12-03 10:53:39 +01:00
Nikolai Kosjar
c2eb91e053 CppTools: Update visible documents on project update
With asynchron project managers, creating a new project from a wizard or
re-opening a session will first open the editor documents and then
provide the project information later (it's the other way around with
synchronous project managers). This sequence leave the documents with
various error diagnostics behind. Fixed by re-triggering the re-parsing.

This change does not fix QTCREATORBUG-11606 yet. Though it will trigger
a reparse with the right includes, clang still reports 'file not found'.
Will be addressed by a follow-up patch.

Task-number: QTCREATORBUG-11606
Change-Id: Ib5d251e05accf4268f9b36decc5224b2c75f610c
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
2014-10-15 10:08:00 +02:00
Eike Ziller
ea27143239 Merge remote-tracking branch 'origin/3.2'
Conflicts:
	src/libs/utils/ipaddresslineedit.cpp
	src/libs/utils/logging.h
	src/plugins/analyzerbase/AnalyzerBase.pluginspec.in
	src/plugins/android/Android.pluginspec.in
	src/plugins/android/androiddeploystep.cpp
	src/plugins/android/androiddeploystep.h
	src/plugins/android/androiddeploystepfactory.cpp
	src/plugins/android/androiddeploystepwidget.cpp
	src/plugins/android/androidpackagecreationfactory.cpp
	src/plugins/android/androidpackagecreationstep.cpp
	src/plugins/android/androidpackagecreationstep.h
	src/plugins/android/androidpackagecreationwidget.cpp
	src/plugins/android/androidpackagecreationwidget.h
	src/plugins/android/javafilewizard.cpp
	src/plugins/autotoolsprojectmanager/AutotoolsProjectManager.pluginspec.in
	src/plugins/baremetal/BareMetal.pluginspec.in
	src/plugins/bazaar/Bazaar.pluginspec.in
	src/plugins/beautifier/Beautifier.pluginspec.in
	src/plugins/bineditor/BinEditor.pluginspec.in
	src/plugins/bookmarks/Bookmarks.pluginspec.in
	src/plugins/clangcodemodel/ClangCodeModel.pluginspec.in
	src/plugins/clangcodemodel/clanghighlightingsupport.cpp
	src/plugins/clangcodemodel/clangsymbolsearcher.cpp
	src/plugins/classview/ClassView.pluginspec.in
	src/plugins/clearcase/ClearCase.pluginspec.in
	src/plugins/cmakeprojectmanager/CMakeProjectManager.pluginspec.in
	src/plugins/cmakeprojectmanager/cmakeeditorfactory.cpp
	src/plugins/cmakeprojectmanager/cmakehighlighter.cpp
	src/plugins/coreplugin/Core.pluginspec.in
	src/plugins/cpaster/CodePaster.pluginspec.in
	src/plugins/cppeditor/CppEditor.pluginspec.in
	src/plugins/cppeditor/cppfilewizard.cpp
	src/plugins/cpptools/CppTools.pluginspec.in
	src/plugins/cpptools/cpphighlightingsupportinternal.cpp
	src/plugins/cpptools/cppmodelmanagerinterface.cpp
	src/plugins/cpptools/cppmodelmanagerinterface.h
	src/plugins/cvs/CVS.pluginspec.in
	src/plugins/debugger/Debugger.pluginspec.in
	src/plugins/designer/Designer.pluginspec.in
	src/plugins/diffeditor/DiffEditor.pluginspec.in
	src/plugins/emacskeys/EmacsKeys.pluginspec.in
	src/plugins/fakevim/FakeVim.pluginspec.in
	src/plugins/genericprojectmanager/GenericProjectManager.pluginspec.in
	src/plugins/git/Git.pluginspec.in
	src/plugins/git/gitorious/gitorious.cpp
	src/plugins/git/gitorious/gitorious.h
	src/plugins/git/gitorious/gitoriousclonewizard.cpp
	src/plugins/git/gitorious/gitorioushostwidget.cpp
	src/plugins/git/gitorious/gitorioushostwidget.h
	src/plugins/git/gitorious/gitorioushostwizardpage.cpp
	src/plugins/git/gitorious/gitoriousprojectwidget.cpp
	src/plugins/git/gitorious/gitoriousprojectwidget.h
	src/plugins/git/gitorious/gitoriousprojectwizardpage.cpp
	src/plugins/git/gitorious/gitoriousprojectwizardpage.h
	src/plugins/git/gitorious/gitoriousrepositorywizardpage.cpp
	src/plugins/git/gitorious/gitoriousrepositorywizardpage.h
	src/plugins/glsleditor/GLSLEditor.pluginspec.in
	src/plugins/glsleditor/glsleditorfactory.cpp
	src/plugins/glsleditor/glslfilewizard.cpp
	src/plugins/helloworld/HelloWorld.pluginspec.in
	src/plugins/help/Help.pluginspec.in
	src/plugins/imageviewer/ImageViewer.pluginspec.in
	src/plugins/ios/Ios.pluginspec.in
	src/plugins/macros/Macros.pluginspec.in
	src/plugins/mercurial/Mercurial.pluginspec.in
	src/plugins/perforce/Perforce.pluginspec.in
	src/plugins/projectexplorer/ProjectExplorer.pluginspec.in
	src/plugins/pythoneditor/PythonEditor.pluginspec.in
	src/plugins/pythoneditor/pythoneditorwidget.cpp
	src/plugins/pythoneditor/wizard/pythonfilewizard.cpp
	src/plugins/qbsprojectmanager/QbsProjectManager.pluginspec.in
	src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp
	src/plugins/qmakeprojectmanager/QmakeProjectManager.pluginspec.in
	src/plugins/qmakeprojectmanager/profileeditorfactory.cpp
	src/plugins/qmldesigner/QmlDesigner.pluginspec.in
	src/plugins/qmljseditor/QmlJSEditor.pluginspec.in
	src/plugins/qmljseditor/qmljseditorfactory.cpp
	src/plugins/qmljstools/QmlJSTools.pluginspec.in
	src/plugins/qmlprofiler/QmlProfiler.pluginspec.in
	src/plugins/qmlprojectmanager/QmlProjectManager.pluginspec.in
	src/plugins/qnx/Qnx.pluginspec.in
	src/plugins/qtsupport/QtSupport.pluginspec.in
	src/plugins/remotelinux/RemoteLinux.pluginspec.in
	src/plugins/resourceeditor/ResourceEditor.pluginspec.in
	src/plugins/resourceeditor/resourcewizard.h
	src/plugins/subversion/Subversion.pluginspec.in
	src/plugins/tasklist/TaskList.pluginspec.in
	src/plugins/texteditor/TextEditor.pluginspec.in
	src/plugins/texteditor/basetexteditor_p.h
	src/plugins/texteditor/basetextmark.cpp
	src/plugins/texteditor/codeassist/basicproposalitemlistmodel.h
	src/plugins/texteditor/codeassist/defaultassistinterface.h
	src/plugins/texteditor/codeassist/iassistproposalitem.cpp
	src/plugins/texteditor/itexteditor.cpp
	src/plugins/texteditor/itexteditor.h
	src/plugins/texteditor/itextmark.cpp
	src/plugins/texteditor/plaintexteditor.cpp
	src/plugins/texteditor/plaintexteditor.h
	src/plugins/texteditor/texteditoractionhandler.cpp
	src/plugins/todo/Todo.pluginspec.in
	src/plugins/updateinfo/UpdateInfo.pluginspec.in
	src/plugins/valgrind/Valgrind.pluginspec.in
	src/plugins/vcsbase/VcsBase.pluginspec.in
	src/plugins/welcome/Welcome.pluginspec.in
	src/plugins/winrt/WinRt.pluginspec.in
	tests/auto/debugger/temporarydir.h

Change-Id: I254af8be8119fe9855287909e17d4b8ca9d2fc2f
2014-10-14 15:36:16 +02:00
Eike Ziller
8295b503be License update
Change-Id: I3c22ef2685d7aa589f5d0ab74d693653a4c32082
Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
2014-10-09 11:41:44 +02:00
David Schulz
78c707760e Cpp: Adjust includes when files are renamed.
Change-Id: Ie6aaaa5d99ba3823d9d42331f45b2dcab397e1cd
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2014-10-02 15:09:20 +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
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
Orgad Shaneh
9d3ed02854 CppTools: Fix compilation with recent gcc 4.9.2
See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62224

.obj/release-shared/cppcodemodelinspectordialog.o: In function `CppEditor::Internal::CppCodeModelInspectorDialog::refresh()':
cppcodemodelinspectordialog.cpp:(.text+0x79fc): undefined reference to `CppTools::Internal::CppModelManager::ensureUpdated()'
.obj/release-shared/cppcodemodelinspectordialog.o: In function `CppTools::Internal::CppModelManager::definedMacros()':
cppcodemodelinspectordialog.cpp:+0x26): undefined reference to `CppTools::Internal::CppModelManager::ensureUpdated()'
.obj/release-shared/cppcodemodelinspectordialog.o: In function `CppTools::Internal::CppModelManager::headerPaths()':
cppcodemodelinspectordialog.cpp: +0x26): undefined reference to `CppTools::Internal::CppModelManager::ensureUpdated()'

Change-Id: Ie0e01f7628668cbbe11b701a93caef98bb8e335f
Reviewed-by: Adam Majer <adamm@zombino.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
(cherry picked from commit c023a1cac1)
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2014-09-19 11:38:58 +02:00
Orgad Shaneh
c023a1cac1 CppTools: Fix compilation with recent gcc 4.9.2
See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62224

.obj/release-shared/cppcodemodelinspectordialog.o: In function `CppEditor::Internal::CppCodeModelInspectorDialog::refresh()':
cppcodemodelinspectordialog.cpp:(.text+0x79fc): undefined reference to `CppTools::Internal::CppModelManager::ensureUpdated()'
.obj/release-shared/cppcodemodelinspectordialog.o: In function `CppTools::Internal::CppModelManager::definedMacros()':
cppcodemodelinspectordialog.cpp:+0x26): undefined reference to `CppTools::Internal::CppModelManager::ensureUpdated()'
.obj/release-shared/cppcodemodelinspectordialog.o: In function `CppTools::Internal::CppModelManager::headerPaths()':
cppcodemodelinspectordialog.cpp: +0x26): undefined reference to `CppTools::Internal::CppModelManager::ensureUpdated()'

Change-Id: Ie0e01f7628668cbbe11b701a93caef98bb8e335f
Reviewed-by: Adam Majer <adamm@zombino.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2014-09-08 10:13:55 +02:00
Erik Verbruggen
cc70b603d3 C++: Change QStringList to QSet<QString> to prevent conversions.
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>
2014-09-04 15:59:40 +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
Nikolai Kosjar
0f3032f840 CppTools: Tests: Add "Find Errors Indexing" mode
Adding QTC_FIND_ERRORS_INDEXING=1 to the run environment will Creator
force to do some "extended indexing" in order to find bugs:

   1) The project files are parsed as if they would be opened in an
      editor. That is, parsing happens as precisely as possible, based on
      the ProjectPart information.

   2) Symbols are looked up by invoking CheckSymbols, the backend of the
      semantic highlighter.

   3) A "Task List File" (*.tasks) will be written with all diagnostic
      messages.

This special indexing mode is meant for testing purposes. E.g. it can be
run nightly on some bigger projects to find regressions.

Note that Qt Creator will quit exactly after the first time some source
files are indexed. E.g. that will happen if you open a file manually or
if you open a new unconfigured project. Therefore it's required to
configure projects as needed before invoking in this indexing mode.

Change-Id: If25b83e67d24df9e28e107cb062f21cbf3b4c643
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2014-08-07 11:04:53 +02:00
Erik Verbruggen
3d33886e53 C++: fix include/framework path handling.
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>
2014-07-04 13:51:36 +02:00
Erik Verbruggen
13d2d499ab C++: move post-sourceprocessing action into callback.
Change-Id: Iac6c9fe1ada27ac0d96417e490cc5723e6969541
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2014-06-18 11:04:35 +02:00
Nikolai Kosjar
a6e04c363f CppTools: CppHighlightingSupport takes a BaseTextDocument
...instead an ITextEditor.

The ITextEditor was only used to access the file path and QTextDocument
via the BaseTextEditorWidget.

Change-Id: Idef2b8162b992fe3718e16e2a046e2ff214846f2
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2014-06-12 17:02:52 +02:00
Nikolai Kosjar
fc7f5ba364 CppTools: CMM::completionAssistProvider takes a mimeType
No need to pass more than needed.

Change-Id: I047cc44f17342999e0809d022df35ba9a4a8dfb8
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2014-06-12 17:02:36 +02:00
Nikolai Kosjar
5f7f6f877a CppTools: Remove some duplicate code
Change-Id: I83c0bbcf221fd163cd2514a9d23983b82e1f04fd
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2014-06-10 15:13:16 +02:00
Nikolai Kosjar
11845cd3dc CppTools: Unexport some internal classes.
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>
2014-06-10 15:12:50 +02:00
Orgad Shaneh
589535c120 CppTools: Pass some const variables by reference
Change-Id: I3e703c923f6e1a14a89c76f394a070184db0c7bf
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2014-05-21 15:50:10 +02:00
Nikolai Kosjar
fd5de10f2f CppTools: Encode more information in log file of CppCodeModelInspector
Among others the timestamp and if provided, some extra id.

Change-Id: I017c2af197023347c88f2547e7bda8f22b3d00c4
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2014-03-26 15:57:58 +01:00
Fawzi Mohamed
d24cb60d48 qml: moving most of ModelManager logic to ModelManageInterface
Currently ModelManager contains lot logic, but as it sits in QmlJSTools
it is not possible to use it in standalone tests.
Moving most of the logic to ModelManagerInterface (and cleanup)
to allow better testing, and refactoring.
This introduces a dependency of the qmljs lib on the cplusplus lib
Also a (small) part of the CppTool::ModelManagerInterface has been
moved to CPlusPlus::CppModelManagerBase to remove the dependency on
CppTools to gather the Qml types exposed from C++.

Change-Id: Icad7fe96dfd0f1a2b1058d82bd98c77c40aa5e9d
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
2014-02-19 21:18:58 +01:00
Eike Ziller
236ea9efb9 Merge remote-tracking branch 'origin/3.0'
Conflicts:
	share/qtcreator/debugger/dumper.cpp
	share/qtcreator/debugger/dumper_p.h
	share/qtcreator/debugger/test/main.cpp
	src/plugins/debugger/gdb/classicgdbengine.cpp
	src/plugins/debugger/gdb/pythongdbengine.cpp
	src/plugins/debugger/lldblib/guest/lldbengineguest.cpp
	src/plugins/debugger/lldblib/guest/lldbengineguest.h
	src/plugins/debugger/lldblib/guest/main.cpp
	src/plugins/debugger/lldblib/ipcengineguest.cpp
	src/plugins/debugger/lldblib/ipcengineguest.h
	src/plugins/debugger/lldblib/ipcenginehost.cpp
	src/plugins/debugger/lldblib/ipcenginehost.h
	src/plugins/debugger/lldblib/lldbenginehost.cpp
	src/plugins/debugger/lldblib/lldboptionspage.cpp
	src/plugins/qbsprojectmanager/qbsstep.cpp
	src/plugins/qbsprojectmanager/qbsstep.h
	src/plugins/qmlprofiler/canvas/qdeclarativecanvas.cpp
	src/plugins/qmlprofiler/canvas/qdeclarativecanvas_p.h
	src/plugins/qmlprofiler/canvas/qdeclarativecontext2d.cpp
	src/plugins/qmlprofiler/canvas/qdeclarativecontext2d_p.h
	src/plugins/qmlprofiler/canvas/qmlprofilercanvas.cpp
	src/plugins/qnx/blackberrycheckdevmodestep.cpp
	src/plugins/qtsupport/debugginghelper.cpp

Change-Id: Ie9fd0a885fb6264a6a8a72daee071b75bcbd2e9d
2014-01-08 11:01:06 +01:00
Robert Loehning
746c5d8863 Incremented year in copyright info
Change-Id: Ib5423fdd064e4546f848c0b640b0ed0514c26d3a
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com>
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2014-01-08 08:29:47 +01:00
Nikolai Kosjar
746da71527 CppEditor/CppTools: Avoid triggering garbage collector on editor close in tests
Closing an editor might trigger a timer which leads to the invocation of
the garbage collector. This is unfavourable for the plugin tests since a
test function closing an editor might influence a subsequent test
function (e.g. files get removed from the global snapshot although they
were added shortly before).

Change-Id: Ia80c11f99e2437fe145dc2d983b21962539b5181
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2014-01-07 14:19:43 +01:00
Eike Ziller
e035ae6df1 Merge remote-tracking branch 'origin/3.0'
Conflicts:
	share/qtcreator/debugger/stdtypes.py
	src/plugins/qmlprofiler/qmlprofilereventsmodelproxy.cpp

Change-Id: I5d86746d58960e41e01e725ccb2a6c00890f0dfd
2013-12-18 11:02:16 +01:00
Nikolai Kosjar
a8e7b6bd38 CppEditor: Use the project part chosen with CppPreProcessorDialog
...otherwise the CppPreProcessorDialog is only semi-useful.

Change-Id: I6b80967b05e7c9a51cd78ae064a3d78170948e32
Reviewed-by: David Schulz <david.schulz@digia.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2013-12-16 10:32:26 +01:00
Erik Verbruggen
d20dd06abb C++: remove superfluous forward defines.
Change-Id: I962e0fbafdb2281645b98779a421d1084d223570
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2013-12-10 16:03:54 +01:00
Nikolai Kosjar
90130f4596 CppTools: Tests: Fix crash in test_modelmanager_gc_if_last_cppeditor_closed
The project that was referenced at cppeditor.cpp:711 was already
deleted. CppModelManager::m_fileToProjectParts contained outdated
information. Now it is updated if a project is closed.

Exposed by commit d411c07.

Change-Id: I6fee93a02c72a045dd44a05723ab39a1eeec616e
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2013-10-09 15:02:45 +02:00
Erik Verbruggen
ba2d7a4fa7 C++: Only parse with appropriate defines for open editors.
If two files from different (sub-)projects include the same header file,
and the defined macros differ for both files, the header file will be
parsed with only the appropriate macros for the including file.

Task-number: QTCREATORBUG-9802
Task-number: QTCREATORBUG-1249

Change-Id: I560490afa287b3bb1e863bce1bb4f57af36ad56e
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2013-10-01 10:33:51 +02:00
Erik Verbruggen
c9f5a14bdd C++: add code-model settings to choose one by mime-type.
The model-manager now supports multiple code models for semantic
highlighting and code completion, and will choose one based on the
mime-type of the editor.

The settings page is currently disabled. It will get enabled when a
second plug-in lands that has a ModelManagerSupport class.

Change-Id: I10023f52322ed6860397da15dba1c231e80e6517
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2013-09-13 14:37:48 +02:00
Erik Verbruggen
3a5d3a2fe9 C++: unify highlighting/code-completion support "factories".
Both semantic highlighting and code-completion go hand-in-hand, so now
the ModelManagerSupport class acts as a "factory" for the model manager.
Depending on the mime-type of the document in the editor, the model
manager will return the appropriate highlighter or code-completion
engine. If none is registered, the built-in fall-back is used.

Change-Id: I3e5dbb0e3b58e077dd5eda9aecb2ce5d448ac0b8
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2013-09-10 11:45:38 +02:00
Erik Verbruggen
87a3aac18f C++: add fallback project part querying
When a file is not part of any other project part, this project part can
be used to get at least some compiler flags, defines, etc. to use. This
can happen when either a file outside a project is opened, or when the
project description is incomplete.

Change-Id: I5d595fae7195e8b61dbad14368b6cae9eb15c21b
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2013-09-10 07:36:25 +02:00
Erik Verbruggen
b4a1bd415f C++: clean-up CppCompletionAssist.
This is step 1 of 2 for merging the various provider factories into a
single class. Merging has the advantage that selecting based on editor
(content) mime-type only has to select one class, instead of re-doing
the selection for each class separately.

Change-Id: I11f815151bd4769ae6028b636793d6a80d02e202
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2013-09-09 11:59:14 +02:00
Erik Verbruggen
7516ef4969 TextEditor: get CompletionAssistProvider from editor.
And not from the global object pool. This way, the editors that have
different highlighters for various language dialects, or editors that
support multiple languages in a single editor, can decide themselves on
what CompletionAssistProvider to provide.

Change-Id: Ieebc4a8e7b3de6470fdb8103035aa3b8b2ba6598
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2013-09-09 10:15:55 +02:00
Erik Verbruggen
073e5d6632 C++: optionally let the highlighter handle ifdefed-out blocks.
Change-Id: I38cc0e55348cac0245d2ab8f3e39c68de76e3e6d
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2013-08-19 13:01:07 +02:00
Nikolai Kosjar
c983053c9c CppTools: Fix signal redefinition
...leading to the error message

QMetaObject::indexOfSignal: signal aboutToRemoveFiles(QStringList) from
CppTools::CppModelManagerInterface redefined in
CppTools::Internal::CppModelManager

Change-Id: I0a1c307ad5fc0d7cefa198726f534140192facad
Reviewed-by: David Schulz <david.schulz@digia.com>
2013-08-14 08:26:06 +02:00
Nikolai Kosjar
8ea14767af CppTools: Rework handling of ProjectInfo changes
(a) The code model manager figures out by itself which files were added
    or removed from the project.

    If this was done successfully, check also the timestamp of the
    common files and reindex if necessary.

(b) A full reindexing is only triggered if the project configuration
    changes (defines, includes, framework paths).

(c) If project files were removed, the garbage collector is called.

Task-number: QTCREATORBUG-9730
Change-Id: Ib855614b070880576233a3525813617c967a72f3
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
2013-08-13 14:13:33 +02:00
Nikolai Kosjar
2665a1249b CppTools: Do not garbage collect files in the working copy
...except the configuration file if no projects are open. For this case
there is no need to keep the configuration file around.

Task-number: QTCREATORBUG-9829

Change-Id: I51b01b30c17cbc1ced491ef2c47c338dae6ed983
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2013-08-08 12:12:31 +02:00