Global variables with names such as "CurrentProject*", "CurrentKit*" etc
are harmful, because the term "current project" as used in Qt Creator
does not refer to the "active project", but simply stands for the
project that contains the node that is currently selected in the project
tree, which in turn may or may not correspond to the current editor
document, depending on the "sync with editor" setting. In other words,
the "current project" is almost a random value with little meaning
outside the project tree itself.
Therefore, we remove "CurrentProject*" and friends, except the ones that
are currently intentionally in use. The latter get renamed to
"CurrentDocument:Project*", so their purpose becomes clear. Their old
names are kept around for backward compatibility, but are not suggested
by the variable chooser anymore, so new usages are unlikely and we can
remove them at some point.
We also add some ActiveProject* variants that have been requested in the
past.
Also remove the "CurrentSession" prefix that was deprecated six years
ago.
Fixes: QTCREATORBUG-12724
Fixes: QTCREATORBUG-24606
Change-Id: Ibba5d0e0ce3d2beb444a5eec01fbb9b745d90a1d
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
We override the Q_PROPERTY macro in our own header. This appears to have
two effects:
1) The macro arguments are properly highlighted.
2) There is no completion from libclang for Q_PROPERTY, meaning our
own helpful snippet is the only completion candidate.
I don't understand the reason for either of these; they seem to be more
or less random effects of parsing peculiarities.
As it turns out, our macro redefinition breaks if the type of the
property is based on a template class, leading to false errors in the
code model. Removing our macro redefinition fixes the code model, but
also removes the aforementioned effects. Turning the macro into a
variadic macro fixes the code model and keeps effect 1), but not effect
2). Therefore, we also update the snippet to provide an extra string
that makes it clear this it's a helpful snippt, rather than just a
normal completion.
Fixes: QTCREATORBUG-24243
Change-Id: I4044d5e633af3ebdba36032d5efd3333b5a36214
Reviewed-by: David Schulz <david.schulz@qt.io>
Use the same syntax already used in the custom wizard to denote
variables that are modified to be lower-/title-/uppercase:
$tESt:u$ will become TEST
$tESt:c$ will become TESt
$tESt:l$ will become test
The snippet will be inserted without any name mangling happening.
Once the editing is done the name mangling is applied to all fields.
Change-Id: I7c1f5a1ad2bb5acf1b88b54de51bb39391c64763
Reviewed-by: David Schulz <david.schulz@digia.com>
e.g.
for (int $var$ = 0; $var$ < $total$; ++$var$) {
$$
}
In final, we need put the cursor at the $$ position.
This makes the code easier to write.
Change-Id: Ied1e6f6bc15277dae43d3052bfb2543124afcb82
Merge-request: 2207
Reviewed-on: http://codereview.qt-project.org/6165
Reviewed-by: Leandro T. C. Melo <leandro.melo@nokia.com>