Commit Graph

2563 Commits

Author SHA1 Message Date
Ivan Donchevskii
7a7123b1bc Clang: add globalFollowSymbol to RefactoringEngine
Allows to follow outside of current TU.

Change-Id: Ieea2fd72bfdf6d60a988b40efcf2f41c5a71d045
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2017-12-14 14:25:14 +00:00
Ivan Donchevskii
c760804102 Clang: always use -isystem for compiler options builder
We always provide the full includes list ourselves so
it will not change the includes order.

Change-Id: I84ee2ca7f05bfb71ae400f0e9e0b8f52810252b3
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2017-12-14 14:24:35 +00:00
Tobias Hunger
7c35a38100 Session: Move all functionality related to Nodes into ProjectTree
Do no longer expose Nodes from the SessionManager's API. These are now
exclusively handled by the ProjectTree.

Change-Id: I585c2ac919462073870363436e767640775d9045
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-12-12 13:44:09 +00:00
Tobias Hunger
18f38ff18e Project: Make Project::files return a FileNameList
Change-Id: I75ceb22ac65b8288d824f229d44089cba6fc8ea3
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-12-08 09:09:59 +00:00
Ivan Donchevskii
8afa7a64cc Clang: Plugins: Put settings into the TabWidget
Make tidy/clazy switch more intuitive.

Change-Id: I13d17376bdace039ae371693e28f6fcb0b493244
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2017-12-07 13:36:51 +00:00
Ivan Donchevskii
6953996aa8 Clang: Plugins: Make default settings empty
Plugins make code model slower. So do not enable them
until you need them.

Change-Id: Idaba0509417d70b41b88b5d66d731a1dae0e9c2f
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2017-12-06 07:33:27 +00:00
Ivan Donchevskii
8efb598e60 TextEditor: move Link class to separate header in Utils
Link is a common class and is used across the plugins.

Change-Id: Id92e47e1b8604316ca8b970804e57abaf404ec28
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-11-27 13:57:02 +00:00
Eike Ziller
4c8db5e9b7 Merge remote-tracking branch 'origin/4.5'
Change-Id: I32715e2fdbb14e4fccc4c58d3fd6052d7c1127f3
2017-11-24 10:03:38 +01:00
Orgad Shaneh
b43e22b8f4 CppTools: Disable Qt keywords for C files
Task-number: QTCREATORBUG-1478
Change-Id: I29afc0f38e5f86ca2c30d5b6551974df68ee7512
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2017-11-24 08:43:27 +00:00
Orgad Shaneh
ec86bf8ca6 CppTools: Fix initial macro parsing for generic project
The extra macros in the config files are being read in
CppModelManager::internalDefinedMacros(), but they also affect the language
features in ProjectPart::updateLanguageFeatures().

Task-number: QTCREATORBUG-1478
Change-Id: Ic197b0b7d4cc6e6a74637da0c710b0630daae25c
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2017-11-24 08:40:56 +00:00
Nikolai Kosjar
807ef044bf Clang: Remove unused function
Change-Id: Ia76e8cf523b301865d902a3768439a648c23da01
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-11-22 14:02:40 +00:00
Christian Stenger
2ab27c0842 CppTools: Fix compile with Qt5.6 and gcc4.9
Change-Id: I47668b784106c78444869595143ec8aff6928e8f
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2017-11-22 13:55:59 +00:00
Ivan Donchevskii
63ea3ac004 Clang: Improve code model plugins settings UI
Describe clazy levels, improve layouts.

Change-Id: I4895682ea7d10ea910c2d53725073c9c870bb306
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2017-11-22 13:33:54 +00:00
Ivan Donchevskii
08e3d8f011 Clang: Android: fix clang code model errors
Add missing gcc include directories in Android toolchain.
This introduces the similar "magic" that we have in qmake
(*qtsource*/qtbase/mkspecs/common/android-base-head.conf)
but allows us to have those paths wherever we use android
toolchain.

Change-Id: I5740f1f2339fd30670567f24db2be2454f665f41
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-11-22 10:56:10 +00:00
Ivan Donchevskii
1601f53542 Clang: StaticAnalyzer: use the default compiler options builder
Analyzer has clang path and can generate necessary header paths
to be able to use default options builder.

Change-Id: I9bb1fc158f045f6e099817c5557ee7d9e38416fb
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2017-11-22 10:55:44 +00:00
Eike Ziller
89f9f22035 Merge remote-tracking branch 'origin/4.5'
Conflicts:
	src/plugins/clangcodemodel/clangutils.cpp
	src/plugins/cpptools/clangcompileroptionsbuilder.cpp
	src/plugins/cpptools/compileroptionsbuilder.cpp

Change-Id: I0728f08171103259407bbbb35f93b70c2f2e18d0
2017-11-21 13:28:55 +01:00
Ivan Donchevskii
194bde265c Clang: Define __FUNCSIG__ and others for msvc toolchain
Affects __FUNCSIG__, __FUNCTION__ and __FUNCDNAME__.
By default Clang can't concatenate strings under those
macros with other strings.
Because of that we need to define them with empty strings
to make clang compile such cases without errors.

Task-number: QTCREATORBUG-19295
Change-Id: I9a3770ebe56b4b8a49ba9982c5a1ba90c8f0b304
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2017-11-21 11:31:22 +00:00
Nikolai Kosjar
2abf1f29cc Clang: Add identifying macro Q_CREATOR_RUN
Use the same we use for the built-in code model.

This is useful for conditions of pragmas.

Task-number: QTCREATORBUG-16847
Change-Id: I4c83be46bb2b8a23e4c8f70d98e2b4c9572121ee
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-11-21 10:05:31 +00:00
Nikolai Kosjar
cd74eff1ba Clang: Fix coverty scan diagnostics in constructor
CID 1462055:  Uninitialized members  (UNINIT_CTOR) Non-static class
member "m_tidyChecksWidget" is not initialized in this constructor nor
  in any functions that it calls.

Change-Id: Ie6ba9f2714238feb03a9fc4006c0475b658cdf07
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-11-21 10:05:24 +00:00
Ivan Donchevskii
32bae7ef6c Clang: use local renaming based on ClangCodeModel
Provide refactoring engine for ClangCodeModel and
implement missing methods.

Change-Id: If5c913e0c5a7941cd2ced54d0fcfa4d625eadc93
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2017-11-20 10:24:47 +00:00
Ivan Donchevskii
8eececaa96 Clang: add clang plugins checks to code model settings
Add UI controls to change settings and apply them
together with warnings and command line options.
Current settings are not very flexible but should be
easy to test and use without reading tidy/clazy help.

Change-Id: I1ca6b49a42a1169b34a703dd50de0bbc105df28f
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2017-11-16 11:05:21 +00:00
Eike Ziller
2d30d3ddd6 Merge remote-tracking branch 'origin/4.5'
Change-Id: Ib6739725e6b251ea962880e4b72700c5be5a192c
2017-11-14 11:24:03 +01:00
Orgad Shaneh
d2b8076fec CppTools: Fix highlighting when matching with scope
class Foo {
  void funcInside() {}
  void funcOutside();
};

void Foo::funcOutside() {}

Search for Foo::func in the locator. func was not highlighted.

Change-Id: I923bd3ef2df47c5fa030b8899d1b4df7437b1820
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2017-11-14 07:04:07 +00:00
Orgad Shaneh
a6cda6dbe0 Merge remote-tracking branch 'origin/4.5'
Change-Id: I16e3bb9ee3a1e6dc6edf7a65f8a137a25cda4fe3
2017-11-05 16:49:17 +02:00
Orgad Shaneh
bacfc28a36 CppTools: Match also function arguments in locator
Useful when there are several overloads for the same function.

Change-Id: I325bda7d2fdf4108f71a61d5473cd55310c51c28
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2017-11-02 09:26:17 +00:00
Tobias Hunger
3529e785c4 CppTools: Make create* methods return something
Change-Id: I20cfdaef23e9b7c48c9d3b4f27157e771fd9bc7f
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2017-11-01 14:19:29 +00:00
Nikolai Kosjar
5ba40cb7fb Clang: Require LLVM/Clang >= 5.0.0
...for the code model parts and declare 5.0 as the supported version for
the clang static analyzer.

Adapt versions and tests, remove code assuming clang <= 5.0.

LLVM/Clang 5 was released on 07 Sep 2017.

Task-number: QTCREATORBUG-18931
Task-number: QTCREATORBUG-18657
Task-number: QTCREATORBUG-17187
Task-number: QTCREATORBUG-14881
Change-Id: I53b00258ca06a1d2e57f9379dacc54b310687295
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-10-27 14:21:19 +00:00
Ivan Donchevskii
81f5c1c8ec Clang: implement globalRename based on clang Index
Has the same limitations as findUsages.

Change-Id: I8de4df2ecbfd8a4f3073666994398dc43af0d73c
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2017-10-25 13:35:48 +00:00
Ivan Donchevskii
050b4dd2f5 Clang: implement findUsages with existing index
Functionality is limited to the abilities of
current index which is not updated and is
generated only at project open.
Search box temporarily doesn't allow to "Search again".

Change-Id: Id1047f27ad0aafc901f06aa51ad38ceab95eaebb
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2017-10-24 10:46:52 +00:00
Ivan Donchevskii
1184792fe7 CppTools: remove ambiguity in Usages class name
Usages class is used in findUsages and globalRename in further changes.

Change-Id: I2f314e4ebe7828e59fcc3cae824893c96eb21cab
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2017-10-24 10:18:27 +00:00
Marco Bubke
b9d268977e Clang: Add usage functions to symbol query
Change-Id: If68a5119c863e616fea40275136d028abcf441f3
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-10-23 18:13:44 +00:00
Ivan Donchevskii
b10f8484c7 CppTools: merge CompilerOptionsBuilder with Clang one
Since it's never used for other compilers.

Change-Id: I9512692d1dc9f9a701ea2453b7d50005478bed5d
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2017-10-23 12:46:34 +00:00
Nikolai Kosjar
f19facd378 Clang: Add more CLANG-UPGRADE-CHECK markers
Change-Id: I9ee553f29fa7a7f60291e2d7d2a56062dc722b9d
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-10-23 11:02:18 +00:00
Robert Loehning
69c4f8c6b5 Clang: Remove unused variable
Change-Id: I972190b2777dccb142fcd9b382dc6367786dbaf1
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2017-10-23 09:08:58 +00:00
Ivan Donchevskii
5c554c0de9 CppTools: add multiple refactoring engines support
Make model manager able to select the most functional
refactoring engine from the available ones.

Change-Id: I74031c910706fd694a0a7def022531501f1ea005
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2017-10-17 13:32:51 +00:00
Eike Ziller
07bec99e8f Merge remote-tracking branch 'origin/4.5'
Conflicts:
	src/plugins/debugger/debuggerruncontrol.cpp
	src/plugins/projectexplorer/gcctoolchain.cpp

Change-Id: Iaad0659293681cce4266fc3e4ba2a4f2068de911
2017-10-09 12:09:27 +02:00
Andre Hartmann
62d971b30b Locator: De-duplicate highlightInfo generation for camel humps
Change-Id: I5a3fd28ddd68b2ac17a76384cffad12064d06259
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-10-05 15:47:13 +00:00
Tobias Hunger
c330cf0679 Replace manual signal blocking/unblocking with QSignalBlocker
Change-Id: Ibb59fab4e37d045e506c5a8172b6f5cbb955b028
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-10-04 09:35:06 +00:00
Andre Hartmann
8730dbd4e6 Locator: De-duplicate RegExp pattern generation
Change-Id: I3576e1507aebed15245e1f197995bfe9e345e32b
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-09-29 07:03:43 +00:00
Christian Stenger
3c602b32d4 AutoTest: Try harder to find relevant build targets
If there are tests defined or registered inside libraries
we ended up trying to execute the library or nothing at all.
If possible try to find correct build targets for such cases.

Change-Id: I58e9edb7f858e3e5407ece6fcb8782f5a129acd0
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2017-09-26 07:00:48 +00:00
Ivan Donchevskii
ad62b1e022 EditorManager: move all openEditor functions to one place
Remove code duplication for openEditor function that
gets search result as a parameter.

Change-Id: I3eb1c41b8a0fda3b2e8a4929cef1d5924295f1f5
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-09-25 14:26:12 +00:00
Ivan Donchevskii
68a49c79da Clang: Unify compiler options builders
Make build command the same for all builders.
Minimize differences.

Change-Id: I1cfe5071b3afb4944ed178fff1e57d3aee45d8a9
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2017-09-22 15:00:48 +00:00
Ivan Donchevskii
80a472740d TextEditor: move convenience from texteditor to utils
Allows to use this header without texteditor dependency.

Change-Id: I706f42799c3ea42473a716fa9ef9f3cfbef6fdd4
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2017-09-22 12:59:35 +00:00
Ivan Donchevskii
a959fe59da C++: remove builtin RefactoringEngine dependency from CppEditor
Move CppRefactoringEngine to CppTools and builtin member
ownership to model manager.

Change-Id: I3e72308559fd2928229f9f25d4dd09beb3f56c34
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2017-09-22 12:59:20 +00:00
Ivan Donchevskii
55a5ffc1ec C++: remove builtin FollowSymbol dependency from CppEditor
Move FollowSymbolUnderCursor to CppTools and
builtin member ownership to internal model manager.

Change-Id: I97a4f744ec1709ccc0b34fb67b58680973ef566f
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2017-09-22 12:59:05 +00:00
Ivan Donchevskii
f130de2400 Clang: use HighlightingMarks for hover with Ctrl highlighting
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>
2017-09-22 12:58:46 +00:00
Ivan Donchevskii
32b1244b2a CppEditor: add startGlobalRenaming
Existing built-in functionality is moved there.
Clang part is to be implemented later

Change-Id: I7595898495213c087243cd534b4ba1617b4c27e9
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2017-09-21 09:20:09 +00:00
Tobias Hunger
2ec0b5a00e CppTools: Fix warning about inconsistent use of override
Use final consistently instead of override.

Change-Id: I38df29fff98273d486bfd97c316492f27737a7c4
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2017-09-20 12:40:09 +00:00
Andre Hartmann
632f2a7709 Locator: Add camel hump locator filter for C++, QML, and files
* Use the CamelHumpMatcher in the C++, QML, and files filters
* Supports matching against UpperCamelCase, lowerCamelCase
  and snake_case strings
* Supports highlighting of matched characters

Task-number: QTCREATORBUG-3111
Started-by: David Kaspar <dkaspar@blackberry.com>
Change-Id: If6220191432ef965bde3c8dbe4a10d89e222ba6f
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-09-19 08:24:38 +00:00
Nikolai Kosjar
656b9f9185 Clang: Restrict warning options edit to single line
...to avoid confusion.

Use a customized QPlainTextEdit instead of a QLineEdit because the
latter does not allow wrapping of long lines. Horizontal scrolling in a
QLineEdit for long/many options is inconvenient.

Change-Id: I15b5f034e04920d0ca955c4f822d882b05e9c235
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-09-19 06:58:34 +00:00