mirror of
https://github.com/MaskRay/ccls.git
synced 2024-11-29 11:01:57 +00:00
Better inside-out syntax recognizer
This commit is contained in:
parent
dd84a85b75
commit
6746883a3b
@ -441,10 +441,11 @@ void SetVarDetail(IndexVar* var,
|
|||||||
// which we can't display well.
|
// which we can't display well.
|
||||||
// For other types, append the textual initializer, bit field, constructor
|
// For other types, append the textual initializer, bit field, constructor
|
||||||
// or whatever.
|
// or whatever.
|
||||||
CXType deref = cx_type, next;
|
CXType deref = cx_type;
|
||||||
while ((next = clang_getPointeeType(deref)).kind != CXType_Invalid)
|
while (deref.kind == CXType_Pointer || deref.kind == CXType_MemberPointer)
|
||||||
deref = next;
|
deref = clang_getPointeeType(deref);
|
||||||
if (clang_getResultType(deref).kind == CXType_Invalid &&
|
if (deref.kind != CXType_Unexposed &&
|
||||||
|
clang_getResultType(deref).kind == CXType_Invalid &&
|
||||||
clang_getElementType(deref).kind == CXType_Invalid) {
|
clang_getElementType(deref).kind == CXType_Invalid) {
|
||||||
const FileContents& fc = param->file_contents[db->path];
|
const FileContents& fc = param->file_contents[db->path];
|
||||||
optional<int> spell_end = fc.ToOffset(cursor.get_spelling_range().end);
|
optional<int> spell_end = fc.ToOffset(cursor.get_spelling_range().end);
|
||||||
|
Loading…
Reference in New Issue
Block a user