Broken by
commit d6e81eb49e
CppEditor: Emit member variable for qproperty refactoring
Change-Id: I5e86f0fb1942a497c4242b6f1890e74eb55b687c
Reviewed-by: David Schulz <david.schulz@qt.io>
The template id for the class name is missing, but it's better than
nothing.
For example:
template<class T>
class Foo
{
void func() {} // Move Definition Outside Class
};
// The following lines are added
template<class T>
void Foo::func() {} // Should be Foo<T>::func
Task-number: QTCREATORBUG-16649
Change-Id: Icb560e0b87f563cbda18f4742f44bb8ef4d8a900
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
The template id for the class name is missing, but it's better than
nothing.
For example:
template<class T>
class Foo
{
void func(); // Add Definition
};
// The following lines are added
template<class T>
void Foo::func() // Should be Foo<T>::func
{
}
Change-Id: I60a0cbd348985def3dfb7037067786e942278593
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
class Foo
{
template<class T>
void func();
};
template<class T>
void Foo::func() {} // Add Declaration should not be triggered at all
Change-Id: Ifff733d8381177300dae017ae419200cfdf5c425
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
class Foo
{
template<class T>
void func();
};
template<class T>
void Foo::func() {} // Move to class
It currently doesn't trigger at all.
Change-Id: I63d561771a8dd455f01e99dd836abbd23eec71b7
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
template<class T>
class Foo { void func(); };
template<class T>
void Foo<T>::func() {} // Move to class
Prior to this change, this currently leaves behind `template<class T>`
where the definition used to be:
template<class T>
class Foo { void func() {} };
template<class T>
Task-number: QTCREATORBUG-14354
Change-Id: I8e1f75a3ae50619a7bae9c63d3798b16bcfea545
Reviewed-by: Lorenz Haas <lorenz.haas@histomatics.de>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
We default to "foo()" for e.g. a member variable "m_foo", but other
coding styles require "getFoo()".
Task-number: QTCREATORBUG-16452
Change-Id: I9ccfdf88e4c469bc1c06fde855ad754faf2bd238
Reviewed-by: André Hartmann <aha_1980@gmx.de>
in places where we do not need it
Change-Id: Ibf35f8144da859fffa3e0a7b6bb262284ec2292a
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
Also extracting inline HeaderPath class and change projects list in vector
because the size is larger than a pointer.
Change-Id: I885fdff3fe9bccc877634d1615249755f5b674fd
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
ASTPath uses TranslationUnit::getPosition(), which returns reasonable
results for:
1. non-expanded tokens
2. expanded but not generated tokens
The expanded *and* generated tokens case is not handled since there is
no reasonable mapping from generated tokens to a continuous line/column
information. Consider:
#define DECLARE_FOO int foo; // Multiple generated tokens
DECLARE_FOO // ...can be mapped to this line, but to which columns?
Since the result where not valid for the expanded and generated case,
ASTPath took the wrong branches. Avoid this by skipping generated
tokens.
Change-Id: I33a2e0f62917f87d691b19feaeef67b09ea8d563
Task-number: QTCREATORBUG-13386
Task-number: QTCREATORBUG-13390
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
As a nice side effect superfluous new lines - introduced by quick fixes
that are using InsertionPointLocator::methodDefinition - vanished.
Task-number: QTCREATORBUG-13872
Change-Id: Ib3df2b2acbc22449f16f4444092a57ae93d53d35
Reviewed-by: Jochen Becher <jochen_becher@gmx.de>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
The "Convert to Stack Variable" quick fix generated invalid code for
the following snippet: QString s = new QString();
Task-number: QTCREATORBUG-14279
Change-Id: I1f5e33d2089bc2d5713eae1e9f4dc5986523112c
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
With a simple check GenerateGetterSetter looks for symbols starting with
"get". If such symbols are found it is most likely that the current
class uses "getFoo" for getters and thus the quick fix uses this coding
style for generating the getter name.
Change-Id: I9ff8ef8bb936572abaaf9e671b8985553c1018f1
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
Since the Q_PROPERTY's name equals the typical getter name the "Generate
Getter" quick fix was not offered.
Q_PROPERTY(int a ...) // <-- a is "recognized" as "int a();"
int m_a;
Task-number: QTCREATORBUG-14166
Change-Id: I35709a1b6492b68309d02427d60251df4fd76cfa
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
In addition to create both getter and setter member functions at once it
can now be decided to only create a getter or setter member function.
Task-number: QTCREATORBUG-13874
Change-Id: I9127a31b7d87dc91619abb2e2335bd8221f170a2
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
Instead of using "arg" for the generated getter/setter/signal argument
try to detect a proper name.
Task-number: QTCREATORBUG-12656
Change-Id: Iddaeb1f1d490af003d172d515033d85d778c10df
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
Mostly done using the following ruby script:
Dir.glob('**/*.cpp').each { |file|
next if file =~ %r{src/shared/qbs|/qmljs/}
s = File.read(file)
s.scan(/^using namespace (.*);$/) {
ns = $1
t = s.gsub(/^(.*)\b#{ns}::((?!Const)[A-Z])/) { |m|
before = $1
char = $2
if before =~ /"|\/\/|\\|using|SIGNAL|SLOT|Q_/
m
else
before + char
end
}
if t != s
puts file
File.open(file, 'w').write(t)
end
}
}
Change-Id: I6fbe13ddc1485efe95c3156097bf41d90c0febac
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
This QuickFix behaves like MoveFuncDefOutside except it moves all
member function definitions. It is triggered on the class name.
Change-Id: I1393a51cad521a7bb58a1ed6223ab0fe4db0e592
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
Make calls like a->b()->c() assignable to a local variable.
Task-number: QTCREATORBUG-10355
Change-Id: If4a55b435c99150710d00567188f901acb2c1a89
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
Trust the matcher to do the job.
Task-number: QTCREATORBUG-13564
Change-Id: I4ff14608a1ce12d3f4424242e50ba71233ac9bfd
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
This should improve results of CI tests where multiple creator instances
execute the plugin tests.
Change-Id: I557a0964568655662108df201589ba369096f4bf
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
We will add another type of test case that allows us to test the list of
offered operations.
Change-Id: I528b3844181c139c8955091ac0bbcf6475fd8a4f
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
* Fixes multiple addition of same include.
* Takes over the check of AddIncludeForForwardDeclaration for forward
headers.
Task-number: QTCREATORBUG-9704
Change-Id: I84629d35ae433385942a9157e5d32ef04159d07f
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
...when adding an include for an undefined identifier.
Change-Id: Ia338e924901262a847d3bd7ed9733d8e66c631dd
Task-number: QTCREATORBUG-10391
Reviewed-by: Christian Stenger <christian.stenger@digia.com>