Fix-its do not follow the current formatting style therefore
apply indention/formatting by using indenter.
This change will work best when ClangFormat plugin is
enabled to not only reindent line but also format it.
Task-number: QTCREATORBUG-21448
Change-Id: I8bcafcf49f3118aff7840326547e7a24052469b2
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Two areas are touched:
1. Select multiple diagnostics if they have the same set
of fix-its.
2. Watch the files and invalidate diagnostics if corresponding
file was edited.
Change-Id: If4487ba91f45c25d1aed1a98990dd9b6df9d7fe2
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
This is a step towards properly supporting multiple debugger
sessions side-by-side.
The combined C++-and-QML engine has been removed, instead a
combined setup creates now two individual engines, under a single
DebuggerRunTool but mostly independent with no combined state
machine. This requires a few more clicks in some cases, but
makes it easier to direct e.g. interrupt requests to the
interesting engine.
Care has been taken to not change the UX of the single debugger
session use case if possible. The fat debug button operates
as-before in that case, i.e. switches to Interrupt if the
single active runconfiguration runs in the debugger etc.
Most views are made per-engine, running an engine creates
a new Perspective, which is destroyed when the run control dies.
The snapshot view remains global and becomes primary source
of information on a "current engine" that receives all menu
and otherwise global input.
There is a new global "Breakpoint Preset" view containing
all "static" breakpoint data. When an engine starts up it
"claims" breakpoint it believes it can handle, but operates
on a copy of the static data. The markers of the static
version are suppressed as long as an engine controls a
breakpoint (that inclusive all resolved locations), but are
re-instatet once the engine quits.
The old Breakpoint class that already contained this split
per-instance was split into a new Breakpoint and a
GlobalBreakpoint class, with a per-engine model for Breakpoints,
and a singleton model containing GlobalBreakpoints.
There is a new CppDebuggerEngine intermediate level serving as
base for C++ (or, rather, "compiled") binary debugging, i.e.
{Gdb,Lldb,Cdb}Engine, taking over bits of the current DebuggerEngine
base that are not applicable to non-binary debuggers.
Change-Id: I9994f4c188379b4aee0c4f379edd4759fbb0bd43
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
Pass id in constructor, so it can be const.
Change-Id: Id33fe19c4416109af8aa05a3ed0a09918eeb5cdf
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This simplifies the toolbar setup and removes the need for the
stack of toolbar widgets.
The actions themselves have been owned by the plugin already,
so nothing changed in this respect.
Change-Id: I44754e16c8fc2acc53633dd9d560b1e732eece27
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Lifetime of the pointed-to object may end before that of
the plugin, so unique_ptr is the wrong choice.
This amends 01f2b982a2.
Change-Id: I76b9ac78348d2ae1e7eff0693b091dbe8475ab93
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Similar to the previous patch, but affecting more plugins: with dynamic
perspectives lifetime is better managed close to the code that knows how
to (re-)construct the items.
Change-Id: I0e7bfcf769d198ec2afa88b972be900baa1b6a46
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Diagnostics do not depend much on project parts. But
having the same file twice can result in duplicated
diagnostics which later can cause the same fix-it
being applied twice and getting corrupted code.
Change-Id: Ie2809af7a54034b05df9383875f7c3123aea58e8
Reviewed-by: David Schulz <david.schulz@qt.io>
Diagnostic may also include fix-its for the header
which require different handling.
Task-number: QTCREATORBUG-20517
Change-Id: I3e745622801be3fa2856d968b0c7a2a2aeb89b50
Reviewed-by: David Schulz <david.schulz@qt.io>
Make possible to select or deselect all fix-its.
Change-Id: I2ff88afb0c451092752ee2cd7c9f083e24033500
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
...if new items are added to the model or if filter is used.
When items were added, we have called
ClangToolsDiagnosticModel::diagnostics() two times:
* from DiagnosticFilterModel::filterAcceptsRow()
* from ClangTidyClazyTool::handleStateUpdate()
However, this does not scale since diagnostics() creates a temporary.
Fix this by accessing the diagnostics or the count directly from the
tree.
Change-Id: I4c6a32e0076c1b4228ed1b1ff9222c9918f92c5c
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
If a file had multiple fixits and only a subset was applied, the
remaining fixits in that file were invalidated. Fix this by adjusting
the locations of the not yet applied fixits.
Change-Id: I2c190412e871e9011c4d4a62ed938e76ad4cdf72
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
...in the fixit column to avoid confusion.
As a side effect, add some error handling.
Change-Id: Ia30e9c9782f3c8021aedd2be7c682853a26d3f39
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
"Apply Fixits" is disabled by default and enabled as soon as some fixits
are checked by the user.
Change-Id: I7e1345512b206f52d1e8628705c81c6b34dfb9ba
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Add a new column to the view that allows to check diagnostics with
fixits. The checked fixits can then be applied with the also new "Apply
Fixits" button in the toolbar.
Some corner cases are not yet handled:
* File is open in editor
* File changed in the mean time
Change-Id: I3d3f353a4150699a0d082f2a4348e331a4213bcf
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
When starting the Clazy/Tidy tool, allow to select the diagnostic
configuration for the run.
As a side effect, fix a race condition where the runner could end up
with no diagnostic config (removed during run) - copy the diagnostic
config instead of referencing/querying it by the id.
Change-Id: Iedafa8f31a3bbd233d65818fe8de16add1e4d443
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
...copy/pasted from the static analyzer tool, which will vanish soon.
Change-Id: I33b6fb8519f9b84d0af3b5ca12c33d66d510c6bb
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
...to some more generic names since they are not anymore specific to the
clang static analyzer.
* ClangStaticAnalyzerDiagnosticView --> DiagnosticView
* ClangStaticAnalyzerDiagnosticFilterModel --> DiagnosticFilterModel
* ClangStaticAnalyzerPreconfiguredSesssionTest -->
PreconfiguredSessionTests
* clangstaticanalyzerprojectsettingswidget.* -->
clangtoolsdiagnosticwidget.*
Change-Id: Ifd34f207d31dc24d6a97654aca76ff27b5025547
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
...copy/pasted from the static analyzer tool, which will vanish soon.
Change-Id: Ibbdd402b66af35b268896eff420bd1c6597d9ced
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
If the run button is clicked, the user is prompted to select the files
for analysis.
Change-Id: I21e4ee6b7c14392a8c1a901ac7aa1c9c16e30f0d
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
... over the whole project.
Generate and read serialized files to get diagnostics.
Change-Id: Iafc25fc70443107a040a995efc038aed35102bbf
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>