[Qt-creator] Offset issue with CPlusPlus::TranslationUnit::getPosition()

Nikolai Kosjar nikolai.kosjar at theqtcompany.com
Wed Jan 28 09:21:00 CET 2015


Hi!

On Tue, 27. Jan 21:10, Carel Combrink wrote:
> Is this a bug or am I doing something wrong?

The C++ lexer got UTF-8 support in Qt Creator 3.2, so I strongly
encourage you to build your plugin against Qt Creator 3.2 or even
better the current version, which is 3.3.

Note that 

    void getPosition(unsigned utf16charOffset,
                     unsigned *line,
                     unsigned *column = 0,
                     const StringLiteral **fileName = 0) const;


expects an UTF-16 offset, but you seem to mix it up with byte offsets
(you pass in token.bytesBegin() to tokenizeWords()).

This plugin looks nice, please think about upstreaming it.

Nikolai




More information about the Qt-creator mailing list