Commit Graph

2563 Commits

Author SHA1 Message Date
Eike Ziller
6990995868 Fix mismatched tag class vs struct
See friend declaration below. That's the reason why we decided to use
'class' almost everywhere.

Change-Id: Icd8ba99528eac28721b403cac0a992ee4d367265
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-03-06 12:15:39 +00:00
Christian Stenger
33f2c24049 CppTools: Fix builtin overview model
5e872c0fcd changed the base class to TreeModel which
needs to have TreeItem inserted to fully work as intended.

This patch makes the overview model work without running
into countless soft asserts when using the builtin code model.

Change-Id: I875529bef03ea2cd9a226b05410fd05e247eded1
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Nikita Baryshnikov <nib952051@gmail.com>
2018-03-02 09:05:21 +00:00
David Schulz
a4b5fc00a8 CodeAssist: use shared pointer to pass around proposal models
Task-number: QTCREATORBUG-17752
Change-Id: Ia41f169b86ead209830e6f15764062389ced2b67
Reviewed-by: hjk <hjk@qt.io>
2018-02-27 12:32:36 +00:00
Ivan Donchevskii
b276de576f CppTools: Replace "\r\n" with "\n" in cpp file content
When we get the file working copy it never contains "\r\n"
line endings. Let's provide the same behavior when we have
no working copy and read the file from disk.

Task-number: QTCREATORBUG-19905
Change-Id: I720d62426860dcdcdd8520db5430d9f4f5900ab6
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-02-23 13:09:20 +00:00
Eike Ziller
7c3cfa166d Merge remote-tracking branch 'origin/4.6'
Conflicts:
	src/plugins/coreplugin/helpmanager.cpp

Change-Id: I2feb60ec0afb2f22f75dc137a01c3fa217b299d8
2018-02-23 10:56:52 +01:00
Ivan Donchevskii
5e872c0fcd Clang: Introduce OverviewModel for clang
Change-Id: I1473e3f679f4345a04c55f1ee80cfe35e21a4347
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2018-02-21 06:55:59 +00:00
Nikolai Kosjar
fc37af56ff CppTools: Disable text edit for built-in clang configs
Otherwise it looks like the options can be customized without copying
the configuration.

Change-Id: I7df26f8f2e3f566f659d12258730d2f514e9d71b
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-02-14 07:24:29 +00:00
Nikolai Kosjar
936d639403 CppTools: Provide hint to copy clang diagnostic config
If a built-in/read-only configuration is selected, show a hint that it
needs to be copied to make customizations.

Change-Id: I62fc51b7548ec7cd6a156a0be84d9dcb41849ee7
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-02-14 07:18:02 +00:00
Eike Ziller
c7fdb93865 Merge remote-tracking branch 'origin/4.6'
Conflicts:
	qbs/modules/qtc/qtc.qbs
	qtcreator.pri
	src/plugins/qbsprojectmanager/qbsrunconfiguration.cpp

Change-Id: I2445882a270731b866b04f28ff87d161224c539a
2018-02-13 13:37:37 +01:00
Ivan Donchevskii
7698d95576 CppTools: Get OverviewModel from model manager
Move ownership and add the placeholder for future clang based
OverviewModel.

Change-Id: Ia44d2c1d0db59b40239d1f7934bf37a02e4b14e6
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2018-02-09 13:29:37 +00:00
Ivan Donchevskii
8389aa144a Clang: Use more generic methods in OverviewModel
Do not return Document or Symbol. Instead use Link
or LineColumn directly as return values.

Change-Id: I1863d7c3b4985ffe2ae5454622227075ebdc2de7
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2018-02-09 13:29:10 +00:00
Ivan Donchevskii
c6d4308ccd CPlusPlus: CppEditor: refactor overview model
Introduce abstract model to be able to use clang
based version of it in follow up patches.
Fix warnings and modernize source code a little.
Move OverviewModel to CppTools.

Change-Id: Idcc9bf03cad047026a456bd01063597a1eb95147
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2018-02-09 12:03:18 +00:00
Nikolai Kosjar
2cedb0531c CppTools: Use radio buttons for clazy options
Change-Id: I7c307cffce58c8dc4fd00d17b5c477c85ba509d8
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-02-08 14:46:05 +00:00
Nikolai Kosjar
8cd96c2142 CppTools: Improve clang diagnostic configuration UI
...by clarifying the widget hierarchy. Ensure that the combo box at the
top is perceived as the main widget:

* Remove the "Configuration to use:" label so the combo box gets more
  horizontal space and thus dominance. Also, rename the group box
  header/label from "Clang Diagnostic Warnigns" to "Clang Diagnostic
  Configuration".
* Move the command line text edit below the combo box into its own tab
  page to clarify the relation to the tidy/clazy tabs.

Change-Id: I97a0785678e33b94746046d07a911422b1469890
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-02-08 14:45:59 +00:00
Ivan Donchevskii
c020f2448b CPlusPlus: Add toLink method to the Symbol
Basically move it from CppTools to CPlusPlus
to be able to use it there.

Change-Id: I0af80f93bdc029824397ceafdf940cb86c4382b0
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2018-02-07 14:01:52 +00:00
hjk
87543118d5 CppTools: Apply 'static' pattern to StringTable
This also fixes a crash on loading (some?) projects introduced
in 577bf7c08a.

Change-Id: Ie35d466fa3b84b183118fe93f55393a4c59755de
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2018-02-07 13:32:08 +00:00
hjk
577bf7c08a CppToolsPlugin: Partially pimpl and remove use of global object pool
Change-Id: Iee09bf2fc7c945b8dcf950edfe94889d35c63735
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-02-07 11:20:22 +00:00
hjk
b16019c95b CppTools: Remove an unused declaration
Change-Id: I165f32678d61e3731fff68982bdb3f5c1791b1f0
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-02-07 11:10:45 +00:00
Eike Ziller
5432dd1f5c Merge remote-tracking branch 'origin/4.6'
Conflicts:
	src/plugins/coreplugin/locator/locator.cpp
	src/plugins/imageviewer/imageviewerplugin.cpp
	src/plugins/remotelinux/remotelinuxplugin.cpp
	src/tools/clangbackend/source/tokeninfo.cpp
	tests/unit/unittest/data/highlightingmarks.cpp

Change-Id: I74cc3ba3a2836cb9d0e65d3380d8c4f88d720c67
2018-02-07 11:58:23 +01:00
Christian Stenger
109c3f06f8 TextEditor: Fix compile with Qt5.6/gcc4.9
Amends 91c19c2734.

Change-Id: I556c2336ac2bbde7f7f2acf4ed9339809a918b55
Reviewed-by: hjk <hjk@qt.io>
2018-02-07 09:06:53 +00:00
hjk
91c19c2734 TextEditor: Simplify SnippetProvider handling
The group identifier is as good as the actual object, so use that
on the generator and the consumer side.

Change-Id: I6ccd54a2362631af0b50583f12563b8e41a5dd78
Reviewed-by: David Schulz <david.schulz@qt.io>
2018-02-07 07:59:05 +00:00
Nikolai Kosjar
88c480ee7c CppTools: Remove unneeded #include
Change-Id: I3b1dd5aa12ba8690ee5de98ccdef99644fff04f9
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-02-07 07:40:35 +00:00
Eike Ziller
ecb9fae785 Merge remote-tracking branch 'origin/4.6'
Conflicts:
	share/qtcreator/qml-type-descriptions/qmlproject.qmltypes
	src/plugins/clangcodemodel/clangeditordocumentprocessor.cpp

Change-Id: I35fb652f29a98a798be7c8b4b4c2e581eb175fb6
2018-02-01 09:58:36 +01:00
Nikolai Kosjar
33b6fe812a Clang: Make clazy/tidy options part of the diagnostic config
As a side effect, clazy/tidy options become available for project
specific customization in the projects mode.

Change-Id: Id72762dedd857915139c15f532d2f1c6d1f43edb
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-01-29 08:14:14 +00:00
Nikolai Kosjar
5b1ae09fbf Clang: Auto reparse if diagnostic config changes
On diagnostic config change, affected documents are closed behind the
scenes. Visible ones are parsed immediately, invisible ones are tagged
for parse once they become visible.

Task-number: QTCREATORBUG-16263
Change-Id: Id4dcc69f1a4bfccc597e798d6821f8718f86e352
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: David Schulz <david.schulz@qt.io>
2018-01-29 08:14:08 +00:00
Nikolai Kosjar
9b4688f1a4 Clang: Let CppCodeModelSettings announce invalidated diagnostic configs
Change-Id: I1fe62d4cd4bc91bfd73e57ace6dc9a87d13b3537
Reviewed-by: David Schulz <david.schulz@qt.io>
2018-01-29 08:13:44 +00:00
Ivan Donchevskii
4ba4079db2 CppTools: Use -isystem only for non-project includes
...and return -I for ones in project.

In case -isystem is set for all includes we don't get
proper reparse when the included file is in angle brackets
and is changed.

Change-Id: Iba912edfc488aed2a4484f6a742a7c36099e8a13
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2018-01-26 14:00:57 +00:00
Eike Ziller
32c938c4a0 Merge remote-tracking branch 'origin/4.6'
Change-Id: I724da8f761275865e735e7dce10c3b2b2d99fe94
2018-01-25 10:20:06 +01:00
Christian Stenger
333d30dce5 ClangRefactoring: Fix compile with Qt5.6/gcc4.9
Change-Id: Ibea187c2216cc9f0a3c6ce53d5139b0a2c7c9065
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-01-25 07:52:40 +00:00
Friedemann Kleint
f482270432 Introduce Q_FALLTHROUGH()
Silence g++ 7.X warnings.

Change-Id: I9d06d04b496c9ec060e13e1be6f43d8fbadb1f3b
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-01-24 14:50:43 +00:00
Ivan Donchevskii
92cdfc0c2a Clang: new empty locator filter classes
Introduce classes to replace builtin locator filters.

Change-Id: I5cc6f15fb0f59ea8a51b14a86301cf219cc0d6d6
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2018-01-24 11:48:42 +00:00
Eike Ziller
437590a999 Merge remote-tracking branch 'origin/4.6'
Change-Id: I49e8b8442e2b5edffbea19cb2bba97443ebc3d2a
2018-01-23 17:06:59 +01:00
Nikolai Kosjar
3ea921c216 CppTools: Move some decls from header to source
...as there is no client using them.

Change-Id: I2fbbe247e6f4bad537644a9574ddcc0606bfa13e
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-01-22 14:25:33 +00:00
Nikolai Kosjar
9f4c55528d CppTools: Remove unused signals/functions
Change-Id: I00420f98eb49acfbcbb7f719b0d3a867a8882d31
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-01-19 14:54:13 +00:00
Nikolai Kosjar
43a3ea1d22 CppTools: Remove pointless loop
Change-Id: Ie6c597421f81529973351a6363c0110435e42c29
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-01-19 14:54:08 +00:00
Nikolai Kosjar
0a4073ef90 TextEditor: Return hover handler priority by callback
...to get rid of the asynchronous code path.

Change-Id: I56377510440631b0be712333b2a4018717c86389
Reviewed-by: David Schulz <david.schulz@qt.io>
2018-01-19 13:57:57 +00:00
Christian Stenger
8177a3c219 CppTools: Fix compile for gcc 4.9
Seems gcc 4.9 cannot handle forward declared classes in uniqe_ptr
correctly. Broke with 7666db896d.

Change-Id: Ib7e7d9d22e5b0a1d50a107202108ec2937e0a284
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-01-18 09:39:33 +00:00
Ivan Donchevskii
7666db896d CppTools: move locators ownership to ModelManager
Move locator and find filters ownership and initialization
to ModelManager. Initialize builtin filters by default and
provide methods to set them from plugins.

Change-Id: I4cc82ecff3415329a5f97b1be9dcc45e6103bf5a
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2018-01-17 11:33:24 +00:00
Nikolai Kosjar
76c25bcd6a Clang: Provide tooltips
This includes also the query data for the help system (F1) for an
identifier under cursor.

Regressions (libclang changes necessary):
 - Function signatures do not contain default values.
 - Aliases are not resolved for/at:
   - template types
   - qualified name of a type

Fixes/Improvements:
 - Resolve "auto"
 - On a template type, show also the template parameter.
 - For a typedef like
     typedef long long superlong;
   the tooltip was "long long superlong", which was confusing.
   Now, "long long" is shown.

New:
 - Show first or \brief paragraph of a documentation comment.
 - Show size of a class at definition.
 - Show size of a field member in class definition.

Task-number: QTCREATORBUG-11259
Change-Id: Ie1a07930d0e882015d07dc43e35bb81a685cdeb8
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2018-01-16 15:32:15 +00:00
Nikolai Kosjar
d7409e01a7 CppTools: Fix showing main help sentence in tooltip
Mouse hover on e.g. "QString" is supposed to show

   QString
   The QString class provides...

The sentence was removed unintentionally by

  commit a7e8406ced
  TextEditor: Remove unneeded functions in BaseHoverHandler

Change-Id: I356e66c0c21c528822c0f2e37f8058fa7b7d89bf
Reviewed-by: David Schulz <david.schulz@qt.io>
2018-01-16 08:31:19 +00:00
Nikolai Kosjar
5e861d2be6 CppTools: Move CppHoverHandler to CppTools
This is in preparation for clang code model to provide its own hover
handler.

Change-Id: Ifbdd96f427989bd5d1fbc4badb9c38108485c2f2
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-01-16 08:31:11 +00:00
Nikolai Kosjar
53a744a6df CppTools: Improve a function name
Change-Id: I30f9048aff18440d8cc6a6247f5fd5bcdba5058d
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-01-16 08:20:22 +00:00
Orgad Shaneh
6285a6e50f CppTools: Fix build
Broke by e51683412b.

Change-Id: I68d1457931f2237a63da4ac2e34f1650b9ff6ea6
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-01-11 06:46:15 +00:00
Ivan Donchevskii
e51683412b ProjectPart: save codegen flags in project part
And add them to other clang code model arguments.
These flags provide architecture for cross-compilation
when ios kit is selected.

Task-number: QTCREATORBUG-19437
Task-number: QTCREATORBUG-19430
Change-Id: I7a485f49d637371bb28b2096086d7d8a4b0c404a
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-01-10 10:59:56 +00:00
Eike Ziller
cff2cc90e2 Merge remote-tracking branch 'origin/4.5'
Conflicts:
	src/plugins/cpptools/clangcompileroptionsbuilder.cpp
	src/plugins/cpptools/clangcompileroptionsbuilder.h
	src/plugins/cpptools/compileroptionsbuilder.cpp
	src/plugins/qmlprofiler/qmlprofilerclientmanager.cpp
	src/plugins/qmlprofiler/qmlprofilerclientmanager.h
	src/plugins/qmlprofiler/qmlprofilertraceclient.cpp
	src/plugins/qmlprofiler/qmlprofilertraceclient.h
	src/shared/qbs

Change-Id: I364ababc5d41046d17e999096c4a7187c4e4e010
2018-01-09 13:13:00 +01:00
Robert Loehning
e07bf2f682 Make missing uses of IDE name configurable
Change-Id: Ie89293b80adfacea19bcb949e4524f16fbb223f9
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2018-01-03 10:26:24 +00:00
Andre Hartmann
6a9c45ab71 CppIncludesFilter: Change default shortcut from 'a' to "ai"
Reason: 'a' is also used for "Files in Any Project",
so there was no way of using both filters exclusively.

Task-number: QTCREATORBUG-19531
Change-Id: Icba0e993b004eb72b8cc419f52b171c5289bc0a1
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-01-03 08:30:43 +00:00
Ivan Donchevskii
b861e31f1a Clang: macOS: fix unknown integer types
Always exclude clang include paths which do not come
with libclang used by code model.
This solves the issue with GCC that uses system clang
include folder on macOS.

Task-number: QTCREATORBUG-19397
Change-Id: I3b4845248a3cf03a95fbd4038856f8fb31346bfa
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2018-01-03 07:56:53 +00:00
Andre Hartmann
b2aa1b9845 Locator: Cleanup and modernize Locator and filters
* Omit QLatin1{Char|String}
* Use member initialization
* Use range-based-for
  (and fixed the cases with non-const Qt container)
* Sort includes to common style

Change-Id: Ibc33a732bb153862efd6d5febfac758229cb61d4
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2017-12-30 18:58:25 +00:00
hjk
cc88302309 De-emphasize PluginManager::getObjects<Type>()
... by additionally keeping local (currently non-owning) pools per
"interesting" type.

Current situation:
  - The global object pool does not scale well for looking up
    objects, as iteration plus qobject_cast typically iterates
    over all pooled objects.
  - User code that can use typed results from the object
    pool need to have access to the full type definition anyway,
    i.e.  depend on the plugin of the target class anyway.

The patch here solves the scaling problem is to have local
type-specific pools to which objects register in their
constructors and deregister in their destructors.

This patch here does *not* change the ownership model of the
pooled objects, however, it opens the possibility to change
the ownership model per type (e.g. by not putting things into
the global pool at all anymore and make the local pool 'owning')
and the intent is to handle that in later patchs.

Even without the follow-up patches this here is a performance
improvement for the cases that access the local pools instead
the global one, i.e. "practically all".

Change-Id: Ib11a42df2c4ecf5e1155534730083a520dd1995b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2017-12-15 07:08:05 +00:00