Clang: Fix dot to arrow correction

The position of the dot character was determined on an outdated
translation unit.

We queried the translation unit for the source location of the dot
character, but apparently clang_codeCompleteAt() does not update the
source locations for the translation unit. And we do not want to reparse
since this is expensive. Thus, determine the byte position manually by
scanning over the document until the right line/column is reached.

Change-Id: I25e256bb81a83bb71c7e46a0fb3e927bf4031b16
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Nikolai Kosjar
2016-04-29 11:35:42 +02:00
parent 9b69b789ab
commit 17c1325cc4
12 changed files with 387 additions and 5 deletions

View File

@@ -33,7 +33,8 @@ HEADERS += $$PWD/clangipcserver.h \
$$PWD/highlightinginformationsiterator.h \
$$PWD/skippedsourceranges.h \
$$PWD/clangtranslationunit.h \
$$PWD/clangtype.h
$$PWD/clangtype.h \
$$PWD/utf8positionfromlinecolumn.h
SOURCES += $$PWD/clangipcserver.cpp \
$$PWD/codecompleter.cpp \
@@ -66,4 +67,5 @@ SOURCES += $$PWD/clangipcserver.cpp \
$$PWD/highlightinginformation.cpp \
$$PWD/skippedsourceranges.cpp \
$$PWD/clangtranslationunit.cpp \
$$PWD/clangtype.cpp
$$PWD/clangtype.cpp \
$$PWD/utf8positionfromlinecolumn.cpp