Syntax highlight rules for keywords are changed to highlight control
keywords and primitive data types separately.
Change-Id: Ifb25be7a97b92589030aa190641320c233dc7f2d
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
With every single change in a document the corresponding IndexItem
elements were extracted and put into an vector. The locator filters
then used these lists to iterate over and filter them.
This change removes that extraction, and the filtering now directly
iterates over the IndexItem elements with a callback.
The exception is the current document filter, because it also queries
for all declarations. Adding this to the model would result in a higher
memory usage, while that information is only used by this filter.
Change-Id: Ibe445cc11e9f68b5d807348fd46c7cac4aff4c85
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
In test_includeGroups_detectIncludeGroupsByIncludeType the test file was
not removed and thus subsequent and isolated executions of this test
failed.
Change-Id: I5eeb4f004f5b146ac794ca913b4092629131fca3
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
And move it into its own header and source files.
Change-Id: I37401badd819e028e1d767425759dc0ff27afe31
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
This is only a small refactoring step towards a editor-free
CppEditorSupport.
Left are m_editor references that need to be addressed.
No functional change.
Change-Id: I9fc7b0abfe88f5b9a6ce3f57a5c4a922ae953ddf
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
...instead an ITextEditor.
The ITextEditor was only used to access the file path and QTextDocument
via the BaseTextEditorWidget.
Change-Id: Idef2b8162b992fe3718e16e2a046e2ff214846f2
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
They belong there. This will also kill the CppSourceProcessor dependency
from CppEditor.
Change-Id: Ic2ae6b0c6f0913d913636be61df194846985d1ce
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
This mostly makes sourceNeeded() a bit more readable.
Change-Id: I8da40090fb499837ec56276e7a4273211920c2d2
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
...since it does quite a bit more than only preprocessing, as the name
suggests. We use that class to process source files in general. The
output is not a preprocessed source, but a set of CPlusPlus::Documents
with symbols.
Change-Id: I787d0f22f9f042ddf0c99e8c2f0bdb9aa7001735
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
This caused displaced highlighting of macro uses after #if constructs.
MacroUse::utf16charBegin() was based on the last "continuation token",
which was wrong.
Change-Id: I89983d82fcf804ba853c04a59a7533c489785d05
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
This image is used exclusively in the CppTools plugin,
thus belong into CppTools resources.
Change-Id: I8bbc553fb16897b74487ad27a941776b83f14d77
Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
* Remove using Utils::ChangeSet from header files
* Remove unused typedef for Range
* Add it only in source files that contain many occurrences
Change-Id: I60a8b77e2d5a46431507f53b6d60186d511ccf30
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
In the light of Obj-C properties this seems to annoy more than to help.
Change-Id: I48f92d505035369f48e8798d0972ef00306bdde0
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
error: C2872: 'Internal' : ambiguous symbol
could be 'CppTools::Internal'
or 'CPlusPlus::Internal'
Change-Id: Iff623400a370b056fb30838e0b97bdc9d6898d00
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
This string table uniques strings, so that multiple identical strings
share their contents. It is used by the locator and the symbol searcher,
and will later be used by the class view.
Change-Id: Ib8b50f69bbf994d0d7a39b66dc8caf1a3d9bfb42
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
This does less calls, and less string concatenations for anonymous
scopes.
Change-Id: Ief07cdcd7daa5710628990abe1486b52a2896d05
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
These days we rather use ProjectPart::Ptr.
Change-Id: I069ad47fe9dd62901e7ac7d43a1850af8cb15f5d
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
...since it's superseded by the class Matcher.
For consistency, rename FullySpecifiedType::isEqualTo() to match().
Change-Id: I07640f9218d814e0350265de45f05929e5d595a9
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
In most cases we need to work with the utf16 indices. Only in
cppfindreferences the byte interface is still needed since there we read
in files and work on a QByteArray to save memory.
Change-Id: I6ef6a93fc1875a8c9a305c075d51a9ca034c41bb
Reviewed-by: Erik Verbruggen <erik.verbruggen@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 necessary in order to add tests with multi-byte UTF-8 code
points. Otherwise the initial and target source code marker positions
will be calculated on the QByteArray (test code) but used with a QString
(editor document).
Change-Id: I108961b13d32912a4d3193cf26eb59f65d296f57
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
...especially in CppTools/CppEditor where the offsets are used with a
QString/QTextDocument.
Change-Id: Ic6d18fbc01fb9cc899a9bd2d7424cd2edae487f1
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
The Lexer can handle it now.
Task-number: QTCREATORBUG-7356
Change-Id: I8c4b03a247656e013d44c3cedca4835e133d4036
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
...and not byte offsets anymore. This is necessary in order to calculate
the line and column numbers correctly with respect to unicode code
points.
Change-Id: I5d79857b3eaefeb8d563b4f1e3938a64debc5e08
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
This will avoid confusion when later more length and indices methods are
added.
In Token:
length() --> bytes()
begin() --> bytesBegin()
end() --> bytesEnd()
Change-Id: I244c69b022e239ee762b4114559e707f93ff344f
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
Required for auto-indenting stream operations. For example:
std::cout << foo
<< bar;
without explicitly invoking the indenter.
Change-Id: I3a88083af5295709dfecb384538078e236119b0b
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
Move item model implementation to private, adjust user code.
Change-Id: Ifbe94e7c7b9b1e8be1b4c531958dbd7a9413af13
Reviewed-by: Eike Ziller <eike.ziller@digia.com>