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: Ief087658e2adc337ee02c49f0fb406597114df07
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
Reviewed-by: hjk <hjk@theqtcompany.com>
Simplifies the code base by removing one level of unused
and unneeded abstraction.
- Merge {I,Default}AssistInterface to AssistInterface
- Merge {IAssist,Basic}ProposalItem to AssistProposalItem
- Merge {IGenericProposal,BasicProposalItemList}Model to GenericProposalModel
Change-Id: I54ee7b095427383d67a00fc1d87c3808c21d812d
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* Consolidate code dealing with C++ identifiers into cpptoolsreuse.h
* Handle code points that are represented with two QChars
Change-Id: I4fb4435aa539f65d88598cac0b50629f33f32440
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
This is a workaround for black tooltips or even crahes when the nvidia
driver is used.
Task-number: QTCREATORBUG-11653
Change-Id: I4ddc09354a9956a55ac6b196a596f3eaeef13670
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
Assumption: model never has 1 entry for immediate result
(there is always the natural result + "Searching for overrides"
Change-Id: I5de7e7933b1309f995a6111a2ab1c7aed31c086e
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
...otherwise subsequent events (e.g. Return) might trigger functions
operating on an invalid model index (see activateCurrentProposalItem).
Task-number: QTCREATORBUG-10589
Change-Id: Ib3e37c8c85c882135970d5d9418d6e69917494c6
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
F2 on a virtual function call presents a list of overrides in derived
classes. The function declaration of the static type is shown
immediately at the top.
Task-number: QTCREATORBUG-9611
Change-Id: I80ce906fa06272dc9fbd1662cd17500b8c77067f
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
... for the same function
Task-number: QTCREATORBUG-5748
Change-Id: Iadf5be76c24f95cf057c2112a8248bea2a9e20cf
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
Since fuzzy completions are allowed, the lexicographically first proposal
is not necessarily most relevant. The patch modifies sorting of proposals
so that the exact match and continuations go first, and fuzzy completions
follow.
Moreover, being a continuation seem to be a more important characteristic
of a proposal, than being it a function argument or keyword etc. That's why
the check for continuation is placed before the check for order.
Task-number: QTCREATORBUG-8737
Task-number: QTCREATORBUG-9236
Change-Id: I89aae9d2ce6bfa59af7c2f75e6f3af00212008ca
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Alexey Zhondin <lexxmark.dev@gmail.com>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
Otherwise it is passed on to other widgets (like the Find toolbar)
Task-number: QTCREATORBUG-5748
Change-Id: I3e7fe19327d2b3d15c9c9f84360b936dc4698dfd
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
#!/usr/bin/env ruby
Dir.glob('**/*.cpp') { |file|
# skip ast (excluding paste, astpath, and canv'ast'imer)
next if file =~ /ast[^eip]|keywords\.|qualifiers|preprocessor|names.cpp/i
s = File.read(file)
next if s.include?('qlalr')
orig = s.dup
s.gsub!(/\n *if [^\n]*{\n[^\n]*\n\s+}(\s+else if [^\n]* {\n[^\n]*\n\s+})*(\s+else {\n[^\n]*\n\s+})?\n/m) { |m|
res = $&
if res =~ /^\s*(\/\/|[A-Z_]{3,})/ # C++ comment or macro (Q_UNUSED, SDEBUG), do not touch braces
res
else
res.gsub!('} else', 'else')
res.gsub!(/\n +} *\n/m, "\n")
res.gsub(/ *{$/, '')
end
}
s.gsub!(/ *$/, '')
File.open(file, 'wb').write(s) if s != orig
}
Change-Id: I3b30ee60df0986f66c02132c65fc38a3fbb6bbdc
Reviewed-by: hjk <qthjk@ovi.com>
Stop resizing width on scrolling the proposal
widget via drag of the scrollbar.
Task-number: QTCREATORBUG-7925
Change-Id: I948a0ec1bba8a9294b8a65b5eaa72063bbede48f
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
The width of the List view showing the
autocompleter proposals is now adjusted
when scrolling.
Task-number: QTCREATORBUG-7185
Change-Id: I5b26ef6195d389b30fdf0964bebd9c2f33056c66
Reviewed-by: Leandro Melo <leandro.melo@nokia.com>
The class' member functions are intended to be used
instead of the Q_OS_* macros in all contexts where
the latter are not syntactically required.
This lowers the likelihood of changes made on one
platform breaking the build on another, e.g. due to
the code model missing symbols in #ifdef'ed out code
when refactoring.
Change-Id: I4a54788591b4c8f8d589b8368a6c683d4155c9fa
Reviewed-by: hjk <qthjk@ovi.com>
this is the behaviour of many OS X widgets, e.g. in Spotlight
Change-Id: Idc769d45d53b332bafdfb8190fd3d14843347776
Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
QT_MAC_USE_COCOA is not defined for Qt 5, which
caused GenericProposalWidget to use a carbon
workaround during key handling.
Add QT_VERSION check. These are the only instances
of QT_MAC_USE_COCOA usage in creator.
Change-Id: I71ee23e14d791166ccd5645c52b152489d7f8f72
Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
Getting the #include directives ready for Qt5. This includes the
new-project wizards.
Change-Id: Ia9261f1e8faec06b9285b694d2b7e9a095978d2b
Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
Now IGenericProposalModel::isSortable also takes the current prefix
as a parameter. This is particularly useful for cases like in the C++
completion: For global completions it will only sort if there's
already a content prefix - Notice, however, that the "sorting threshold"
for a maximum number of items is still kept in IGenericProposalModel::sort.
Task-number: QTCREATORBUG-6404
Change-Id: I3c2f282aa565287b8b4989930b6a27093862ef25
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
We want to carry over all mac-specific code paths
to Qt 5. WS_MAC is no longer set; OS_MAC is.
This change is compatible with Qt 4 builds since
OS_MAC is set whenever WS_MAC is. (OS_MAC would
also be set for the theoretical X11/Mac platform,
but that's anyway not a supported configuration
for Creator)
Change-Id: Ib25d8c4e83e7e27d911124cd48aa17fdb875923f
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
In a relatively recent commit (99fee33fd1)
premature match was setup to work only on explicit invocations. However
this has shown to be too strict. Therefore, it's now a bit relaxed (not
as much as before): If the current item ends with the typed character we
assume this is intenional - general premature matches do not end with
identifier characters anyway.
Note: Leaving only the last character as the condition is not an option
since sometimes they are not shown in the proposal description.
This patch also lifts the text method to IAssistProposalItem since
it's reasonable the every proposal must have at least some description.
Change-Id: I2ef7de2b7f978ce7059cce50175137a03315f495
Reviewed-on: http://codereview.qt.nokia.com/675
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Christian Kamm <christian.d.kamm@nokia.com>
Automatic prefix and implicit completion should only
happen when the setting allows, the popup is synchronized,
and the completion has just been invoked. This means that
if characters are typed afterwards they should not trigger
such behavior.
Change-Id: Iedfc4211d171a21ef0a2daaa475d291e756e7cc0
Reviewed-on: http://codereview.qt.nokia.com/570
Reviewed-by: Thorbjørn Lindeijer <thorbjorn@lindeijer.nl>
Keeping or not the completion popup upon a perfect match
is best identified by the model in question instead of simply
by the triggering reason. For instance, in QML we don't want
to preserve the popup if completion was triggered by an
activation sequence. On the other hand, this is ok for C++
since a semicolon or parenthesis will in general still be
typed (in some cases even with the intention to take advantage
of the automatic bracked insertion).
For more context see 271bd44d2c1daa43c125cc09e6af57bb756de857.
Change-Id: If9dbf33243b623c077ce027e7e46265d0fc4ba8b
Reviewed-on: http://codereview.qt.nokia.com/563
Reviewed-by: Thorbjørn Lindeijer <thorbjorn@lindeijer.nl>
This reverts commit 4959f53d2c.
It seems that usability is better when upon a perfect match the completion
popup stays when triggered either explicitly or by an activation character.
After all, in general one should need to type something else (semicolon,
parenthesis, etc.) anyway for the case of an activation character.
This is also consistent with the behavior from previous releases.
Change-Id: I1d50230affb1d0642f8f8bfd5cbac69dc52e44bd
Reviewed-on: http://codereview.qt.nokia.com/536
Reviewed-by: Thorbjørn Lindeijer <thorbjorn@lindeijer.nl>
This should not only be when the editor is idle but whenever the
completion was not invoked explicitly.
Change-Id: I0f3dbbe2f5db66ae3e1f57c7039a93f74f31e1dc
Reviewed-on: http://codereview.qt.nokia.com/130
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>