This is especially useful when switching between files assigned to
the same type of editor. (e.g. cpp header <-> cpp source)
Change-Id: I0179e7086a6f25cb0ecc0b69da1f61adb21d8ac2
Reviewed-by: Robert Loehning <robert.loehning@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 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>
Simply link to Core instead of duplicating all the files.
There is a warning on Windows because one translation unit
is present twice, but it seems to work anyway.
Change-Id: I6c5af590a6051f5c2d810d9449ff5410cf94e78a
Reviewed-by: Joerg Bornemann <joerg.bornemann@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 save us toLatin1() conversations in CppTools (which already
holds UTF-8 encoded QByteArrays) and thus loss of information (see
QTCREATORBUG-7356). It also gives us support for non-latin1 identifiers.
API-wise the following functions are added to Token. In follow-up
patches these will become handy in combination with QStrings.
utf16chars() - aequivalent of bytes()
utf16charsBegin() - aequivalent of bytesBegin()
utf16charsEnd() - aequivalent of bytesEnd()
Next steps:
* Adapt functions from TranslationUnit. They should work with utf16
chars in order to calculate lines and columns correctly also for
UTF-8 multi-byte code points.
* Adapt the higher level clients:
* Cpp{Tools,Editor} should expect UTF-8 encoded Literals.
* Cpp{Tools,Editor}: When dealing with identifiers on the
QString/QTextDocument layer, code points
represendet by two QChars need to be respected, too.
* Ensure Macro::offsets() and Document::MacroUse::{begin,end}() report
offsets usable in CppEditor/CppTools.
Addresses QTCREATORBUG-7356.
Change-Id: I0791b5236be8215d24fb8e38a1f7cb0d279454c0
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
...by adding capabilities that allow a better differentiation between
Qt4 and Qt5 object structures.
Change-Id: I025d8301c13922e369862eefaad848bbecc76030
Reviewed-by: hjk <hjk121@nokiamail.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>
...by just calling selectBuildConfig.
Change-Id: I8f07b3d874c22ebeca8e5cf658d754cf231c7ad0
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
Some files were missing, which did not manifest itself with qbs 1.2
due to files being accidentally picked up from other locations.
Change-Id: I9ed91246483f4f53bc21a79a9e2029fedb8a702d
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>