Also the updating of the model is now done only once in the document,
and delayed till an editor is visible if necessary.
Change-Id: I69b1abebc2b691b37a618db7d1f5ebbbc8e75bca
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
Call the timer and its slot for what they do, not how they are
triggered. Remove unneeded function/slot.
Change-Id: I6060f0b59149eb7e5cfdf1d7ea0a993a2104f012
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
This ensures that we are only highlighting once, and actually do
highlight (the previous code was trying to prevent multiple rehighlights
though doing the highlighting in the editor(s), resulting in situations
where it wouldn't rehighlight at all)
Change-Id: I18f3e72e31d8076b6d1575f1a17a3f4a101163d9
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
That avoids a complete reparse of the document when font settings
change, but in turn now requires an explicit redo of semantic
highlighting in that case.
The cpp editor part of this patch is actually still doing semantic
parsing though. This will be fixed up in a later patch.
Change-Id: I6f51a18cba6325856c96e155700eb912f6d3aad5
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
Diagnostic ranges also move to document for this.
Change-Id: I82a9909abb57594cdd732448270849e6a2e3a4e0
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
There is no need to fire a timer over and over again if semantic info is
not up to date. Instead, update usages whenever cursor position changes
and semantic info is up to date, and whenever semantic info is updated.
Change-Id: If2d8fe2a0211b9d659bea5c747704380a64cc1ca
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
Also when duplicating editors, we don't want to change the document
after construction. Actually at some places (e.g. CppEditorSupport
creation) we don't handle document changes correctly, and we are only
lucky that things still (more or less?) work. Get rid of
BaseTextEditorWidget::duplicateFrom and use copy-constructor style instead.
Change-Id: I7f688b7fcc51d1bb5e222bb333f0d28479b597a6
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
It was never called with a sensible value anyhow, and only complicates things.
Change-Id: I005848700b6c00114d91495670d4a0e15a2d2e64
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
Doesn't really make sense to have the additional IDocument *editorDocument()
method.
Change-Id: I0a7420eb1afaa76f63c3f7e9c4b373acf624ffb9
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
Moved Document::Language, Import::Type and StaticAnalysis::Severity
enums to qmljsconstants.h and renamed values removing the redundant
part.
Thus the effective length changed little or improved
(Document::QmlLanguage => Language::Qml).
The separate file allows better reuse of enum values without introducing
circular dependencies.
Change-Id: I5186d7c04f5d3f6c289068b919be5ff1ff118326
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@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>
Also adjust and streamline using and surrounding code.
Change-Id: I6a8b05126bdcbb74ff611b21c7cb3c5902a2d5ca
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
That is what it actually is, wrt how Qt API calls it.
Change-Id: Ied02055debf6aad75556b0d9d22e8ba2f72be555
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
Introduces ITextEditorDocument. This is part of a more general "use
documents instead of editors whereever possible". It will allow to move
to e.g. ITextEditor::openedTextDocumentContents() instead of
ITextEditor::openedTextEditorsContents().
Change-Id: I5ebceaa257a0d2c3e8ac4ac51b9b08b6faa42487
Reviewed-by: David Schulz <david.schulz@digia.com>
Steps to reproduce the crash:
1. Open some long file, e.g. botan.cpp
2. Trigger completion and close editor immediately
The IDocument pointer was only used to reference the file name. Instead
of passing an IDocument* to the IAssistInterface, pass the file name.
Change-Id: Iafce9b818806a77968a10541114bc9b7c8665f11
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
Reviewed-by: David Schulz <david.schulz@digia.com>
solve problems depending on the destructor sequence:
- avoid setting code style to a destroyed code style
- avoid hiding a potentially destroyed pane
(which will be cleared in any case)
Task-number: QTCREATORBUG-8818
Change-Id: Idd7817d99bf4ff04c5e152b00857f6e35825fd37
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
...in CppEditor, QmlJSEditor and BinEditor.
Addresses second crash reported at QTCREATORBUG-8775. The first one is
already fixed.
Task-number: QTCREATORBUG-8775
Change-Id: I11c1f030ebeb2b2cbec02503e8e225fc5600a101
Reviewed-by: David Schulz <david.schulz@digia.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
avoid using extra selections for warnings folding them into the
normal semantic update.
Extra selections impose a relatively large overhead (and need expensive
text cursor operations).
Unlike C++ Qml warnings are continuosly recomputed in the current file
of the editor, but not listed in the issue panel, unless one
explicitly triggers the qml checks.
Using the normal sematic update for warnings avoids QTextCursor
operations, and uses batched applies.
Unfortunately getting the tooltips from the additional formats instead
of using the extra selections requires private API, so Ranges are also
stored separately.
Change-log: [Qml/JS Support] Improved speed of QML/JS Editor for large files with lots of warnings.
Change-Id: I1f996231ef35d7cd77a79af58dbae2098fbbc83e
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@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>
Distinguish from const char * one.
QString ctor is yet to be removed
Change-Id: I2da231036c6417353b0566d39666d918ad141c6d
Reviewed-by: hjk <qthjk@ovi.com>
Also removed all <QMainWindow> includes which are not needed
anymore.
Change-Id: I393c9a62a5c6df95d9f35d872e1473a4f13bcdc4
Reviewed-by: hjk <qthjk@ovi.com>