Commit Graph

68 Commits

Author SHA1 Message Date
Eike Ziller
aa6495a261 ExtensionSystem: Remove Qt4 support
Remove usage of the Q_EXPORT_PLUGIN macros, which do not exist in Qt 5.

Change-Id: I678c3cf10b9c5d5c1b9f252b0ecd1c97dc810a47
Reviewed-by: hjk <hjk121@nokiamail.com>
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
2014-08-27 08:44:34 +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
44f0f4dc95 Clang: Remove unused signal PchManager::pchInfoUpdated
Change-Id: Ic8433f398e55eb301134848d42119257b417ab77
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2014-08-25 11:30:51 +02:00
hjk
6431ab2c79 Use Qt 5's QStringList::join(QChar)
Less typing and less cycles than join(QString) where appropriate

Change-Id: I6ebc0e17e4d7fd9845864dd95b7de4ba4dad6906
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2014-08-25 08:21:14 +02:00
Nikolai Kosjar
6b5298faf9 CppTools: Move Project{Part,Info} to new cppprojects.{h,cpp}
Change-Id: Ieff216017b9da1e6a12121688ea9572bdd81fd9b
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2014-08-20 10:28:35 +02:00
Nikolai Kosjar
b8a6a4dd4e CppTools: Move WorkingCopy to new cppworkingcopy.{h,cpp}
Change-Id: I447acf28849bffb52c1e6b6eafdde221ec0b179e
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2014-08-20 10:26:47 +02:00
Nikita Baryshnikov
05ee8a8d5d ClangCodeModel: discard stderr during clang detection
Otherwise we get useless noise in the General Messages pane if clang
isn't installed.

Change-Id: I8d34f79f1054b87b8530fcf6f253524a4c73897c
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2014-08-07 15:08:26 +02:00
hjk
1924fdb90f TextEditor: Merge PlainTextEditor into Base
Same patter. Plain is fully merged now, so remove the files, too.

Change-Id: Id8c0ba5689ad9980a0db3580cb9833344fd911f3
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
2014-07-30 15:17:53 +02:00
hjk
15fcdabc1d ProjectExplorer: Further clean up of IProjectPanelFactory
Rename to ProjectPanelFactory, hide list of factories from .h,
rename include guards.

Change-Id: I2e0befcaf847e5c3a0b493b58e7bcf3e9263f4f9
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
2014-07-28 15:27:08 +02:00
Tobias Hunger
1a1ddf1d82 Build fix
Change-Id: Ic0099118307234eefc8849ec042892a32537b434
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
2014-07-28 13:55:29 +02:00
hjk
96d3449acd TextEditor: Remove itexteditor.{h,cpp}
Move the remaining contents to more appropriate places.

Change-Id: I55eed5c572bd33dafe2187523d9aa381c211fdd6
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
2014-07-25 14:53:11 +02:00
hjk
bf5e43be94 TextEditor: Merge ITextEditor and BaseTextEditor
Adjust all callers, de-export BaseTextEditorAnimator

Change-Id: I2329d976c1398e2449844bb480a4d4ed29859506
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
2014-07-25 13:45:55 +02:00
Christian Stenger
540ac8ce23 ClangCodeModel: Fix compile
Change-Id: I00229f3af2ba85ea14677fe47939a75c309a4116
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2014-07-24 10:47:43 +02:00
Daniel Teske
66757653ff ProjectExplorer: Remove ITargetPanelFactory
The indirection via a factory is no longer useful, since the
targetsettingspanel is hardcoded for a build and run panel.

Change-Id: I75543f777a4a7df4cadf12667652424056829689
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
2014-07-22 16:51:33 +02:00
Daniel Teske
a58325578c Make IProjectPanelFactory a value based class
Change-Id: I40f9411f305ab7764b904306bbccd45887dc7432
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
2014-07-22 16:42:57 +02:00
Daniel Teske
96d9f05fad ProjectExplorer: Remove IPanelFactory
This was the common base class of IProjectPanelFactory and
ITargetPanelFactory. Nothing was using the IPanelFactory interface, and
there's actually no common interface between those classes.

Of the old interface IPanelFactory:
id() => only used in ITargetPanelFactory
displayName() => only used in IProjectPanelFactory
priority() => only used in IProjectPanelFactory

This removes lots of boiler plate code for the unused functions.

Change-Id: I8488a4e5134fd451907f02c45b7847673e4dc714
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
2014-07-22 16:40:52 +02:00
Erik Verbruggen
87dcde5564 Clang: fix Qt4 build.
Change-Id: I0687ec440df7f6ead629e1d0ded4fc9b925c98e5
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2014-07-07 11:28:46 +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
Christian Kandeler
fa46c278c2 ClangCodeModel: Fix qbs project file.
Works now again for the mainstream UNIX case (relying on llvm-config).

Change-Id: Ia928c363a43f54ca56d5371e755c00f4f10fe76f
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2014-07-02 11:44:08 +02:00
Tobias Hunger
8da0742ae2 ProgressManager: Unify style of progress manager task descriptions
Change-Id: I6826e66f00f47997c644c24d1b20f4a1ea53a8a2
(cherry picked from commit 36d8ec4f47)
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
2014-06-25 14:00:30 +02:00
Nikita Baryshnikov
0d43036077 Fix clang compilation
Change-Id: Ic2617b5eca47ebbcc04119dd7e064b8f570fbc09
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
2014-06-20 16:38:38 +02:00
Nikita Baryshnikov
5ee81929ac Fix clang compilation
Was broken in 12103e0f67

Change-Id: I28ce266f609a232bf1ed99bb044ffc6a3b561d57
Reviewed-by: hjk <hjk121@nokiamail.com>
2014-06-20 13:54:02 +02:00
Nikita Baryshnikov
12103e0f67 Reinvent deprecated qSort as Utils::sort
Change-Id: I4f6011cc2b6127037249aabc2426a88ad7108ebf
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
Reviewed-by: hjk <hjk121@nokiamail.com>
2014-06-19 14:00:32 +02:00
Nikita Baryshnikov
84e176edab CleanUp usage of QtAlgorithms
Change-Id: I61be20554014f90c2e1313167a3e3c869e26c35e
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: hjk <hjk121@nokiamail.com>
2014-06-17 08:19:29 +02:00
Erik Verbruggen
17febac88b C++: Rename ModelItemInfo to IndexInfo.
And move it into its own header and source files.

Change-Id: I37401badd819e028e1d767425759dc0ff27afe31
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2014-06-16 12:08:12 +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
e8fab22afb C++: Disable "Replace Dot for Arrow" auto-correction for ObjC sources
In the light of Obj-C properties this seems to annoy more than to help.

Change-Id: I48f92d505035369f48e8798d0972ef00306bdde0
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2014-06-02 15:48:48 +02:00
Sergey Shambir
a940c73d81 ClangCodeModel: fixed build on windows for newer LLVM installs
Latest LLVM release has Windows installer which installs it to Program Files.

Change-Id: I55d7e43d1333f3a7280020e0ebcb1e095acca9d0
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2014-05-28 15:51:51 +02:00
Eike Ziller
6d1cc58697 Merge remote-tracking branch 'origin/3.1'
Conflicts:
	src/plugins/clangcodemodel/test/clangcompletion_test.cpp
	src/plugins/cmakeprojectmanager/cmakeopenprojectwizard.cpp
	src/plugins/projectexplorer/projectexplorer.pro
	src/plugins/qmldesigner/designercore/instances/nodeinstanceserverproxy.cpp
	src/plugins/vcsbase/vcsplugin.cpp
	src/shared/qbs

Change-Id: I9e5882be79ac5e8c7dfab4a57f16509d7569636a
2014-05-16 16:54:50 +02:00
Nikolai Kosjar
126e69137a C++: Clarify units of a Token
This will avoid confusion when later more length and indices methods are
added.

In Token:
    length() --> bytes()
    begin() --> bytesBegin()
    end() --> bytesEnd()

Change-Id: I244c69b022e239ee762b4114559e707f93ff344f
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2014-05-15 15:55:38 +02:00
hjk
6e584b5b49 DocumentModel: Make interface static
Move item model implementation to private, adjust user code.

Change-Id: Ifbe94e7c7b9b1e8be1b4c531958dbd7a9413af13
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2014-05-13 11:48:30 +02:00
Christian Stenger
9c3604ba20 ClangCodeModel: Fix build
Error was introduced with dc61b989ac.

Change-Id: I17217b6fc5f518104fb9f90f9a5fdbea6ef2f49d
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
2014-05-07 13:06:01 +02:00
Nikolai Kosjar
e7ecb490e6 Clang: Compile fix for Qt 4
pchmanager.cpp:325:21: error: 'CppTools::ProjectPart::Ptr' has no member
named 'reset' projectPart.reset();

clangcompletion_test.cpp:305:59: error: no viable conversion from
'QLatin1Char' to 'const QString'
	.arg(text).arg(texts.join(QLatin1Char(','))));

Task-Number: QTCREATORBUG-12122
Change-Id: Ie591594da1e3d357e38efe216d758f15ad6c2cd2
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2014-05-02 14:30:00 +02:00
Eike Ziller
0fb641c90e Merge remote-tracking branch 'origin/3.1'
Conflicts:
	qtcreator.pri
	qtcreator.qbs
	src/libs/qmljs/qmljsmodelmanagerinterface.cpp
	src/plugins/qmldesigner/designercore/instances/nodeinstanceserverproxy.cpp

Change-Id: Ie216b715d6f87a6d72d3b8fe3d4e777e561579f9
2014-05-02 10:00:20 +02:00
Christian Kandeler
eccc1198d6 Use double quotes instead of single quotes as per our guidelines.
Change-Id: Ib608bb49e26781aef1914085a5d801fcdcd5eb56
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com>
2014-04-22 10:06:40 +02:00
Christian Kandeler
4909428220 qbs build: Adapt to function renaming.
Change-Id: Ia4cc4447e59aaa4f283a7818847633bb7cf9a8aa
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2014-04-15 16:57:54 +02:00
Oswald Buddenhagen
6d1d5dd470 replace platform conditional with QMAKE_DIRLIST_SEP
Change-Id: I2646a2c30573417ba9da4b57b100d33144cef349
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2014-04-14 21:02:59 +02:00
Oswald Buddenhagen
1283859116 fix qt4 build: remove extra spaces
qt4 qmake does not like spaces between 'for' and the opening paren.

Task-number: QTCREATORBUG-12024
Change-Id: I8697272b4f752495f3bf6ff2c6d01c4ac2ea837f
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2014-04-14 11:27:21 +02:00
Oswald Buddenhagen
1fb187f513 fix use of $$split()
it takes a variable, not a value.

the spec_pre.prf part is cherry-picked from qtbase/89a558d6b0fac.

Change-Id: Ie7e551cf0b889d7682f032124dd0466ada6972e4
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2014-04-14 09:01:46 +02:00
Oswald Buddenhagen
039c7bed1a remove stray semicolon
Change-Id: I9b98ddc6f3efdf8d16a373fa6e3d92480c8629d6
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2014-04-11 16:22:50 +02:00
Orgad Shaneh
530332c255 CppTools: Replace Method with Function
Change-Id: I6405c4dfa07eba1ea09ba23fe20667769eaca748
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2014-03-31 19:59:39 +02:00
Erik Verbruggen
b0618281ec C++: Do type and name equality checking in a safe manner.
Change the TypeMatcher to also match names, and use two "block" lists
in SafeMatcher to prevent infinite recursion.

Task-number: QTCREATORBUG-11240
Change-Id: I0367ae795ee6be579b83aeb8d46723c877e4aa75
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2014-03-27 13:46:55 +01:00
Nikolai Kosjar
0d84603c41 CodeModel(s): Unify name/values of accessed environment variables
Format: QTC_*=(1|0).

Now it's easier to change them in the Run Configuration of Qt Creator.

Change-Id: Ifc45cecb89b33a31942b4c3e2d03851a1d72d0bf
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2014-03-26 15:57:21 +01:00
Erik Verbruggen
ae24a88e90 Clang: never include a define for __cplusplus.
The flags used by the project explorer to interrogate the toolchain for
compiler-defined #defines always indicate a C++ file. So, this will
always include a #define for __cplusplus. When editing C code with
the clang code model, this results in extern "C" linkage specifications,
which result in warnings or errors.

The proper fix is described in QTCREATORBUG-11709, but is too big to be
done within the 3.1 timeframe.

Task-number: QTCREATORBUG-11501
Change-Id: Id9e261fa8d429fead4a2cd5fd7398aa6e1e8c13d
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2014-03-18 11:08:20 +01:00
Nikolai Kosjar
332caf38be Clang: Print cmd line equivalent if using QTC_CLANG_VERBOSE
...so we can easily check if the bug is in (lib)clang itself.

Change-Id: Id6dfd8014efc1c7704265b99697f19ab990286a7
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2014-03-17 14:48:33 +01:00
Nikolai Kosjar
5031c49cfe Clang: Fix crash if updating pch info
Function-local variable 'updateParams' was referenced after destruction.

Change-Id: Iac9663ba4ca9c3a603bc530f57f419b734782694
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2014-03-07 13:19:35 +01:00
Nikolai Kosjar
a723205f6c Clang: Do not use Core::MessageManager from worker thread
...since that's not thread-safe and thus leads to crashes from time to
time.

Change-Id: I907ae8b5c4d60bfc82bc97b55cc5d62d8bbeae04
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2014-03-05 13:16:27 +01:00
Friedemann Kleint
249a8b2d24 tr()-Fixes in CLANG code model.
Do not use QObject::tr(), use native file paths,
use complete contexts.

Change-Id: Icc4990b4c2ca5b9ae6f6b639db9e1a45a93e0a65
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2014-03-03 18:11:22 +01:00
Erik Verbruggen
346e84d219 C++: introduce a project config file field in the projectPart.
This field is used by the generic project manager which passes the
".config" file in it. The advantage is that both the SnapshotUpdater and
the clang code model do not need to do anything smart, but can pass it
directly to the preprocessor.

Task-number: QTCREATORBUG-11390
Change-Id: I44fc7b20afd28fb59608412f2cce86af6f7e7d6b
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2014-02-27 15:58:17 +01:00
Erik Verbruggen
e6c32fe940 Clang: add back flag indicating incomplete translation units.
This speeds up the semantic highlighting significantly.

Task-number: QTCREATORBUG-11346
Change-Id: I968f066fff7002a9cc10dd9577a750644efe026b
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2014-02-25 13:29:44 +01:00