clang_codeCompleteAt returning invalid completion results

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

clang_codeCompleteAt returning invalid completion results

jaytee
Hello,

I've noticed that clang_codeCompleteAt (using clang 2.9 - unable to upgrade clang version in my application) is returning invalid completion results, although the text chunks of those results appear to be valid. The following is a simple example:
typedef union _myUnionType {
    union {
        int a;
    };
} myUnionType;
void func() {
    myUnionType var;
    var.
}
'var.' is returning a single completion result having a CXCursor_NotImplemented cursor kind.
Does anybody know if there's any risk in using CXCursor_NotImplemented completion results?

Thank you!
Reply | Threaded
Open this post in threaded view
|

Re: clang_codeCompleteAt returning invalid completion results

Douglas Gregor

On Feb 20, 2013, at 1:55 AM, jaytee <[hidden email]> wrote:

> Hello,
>
> I've noticed that clang_codeCompleteAt (using clang 2.9 - unable to upgrade
> clang version in my application) is returning invalid completion results,
> although the text chunks of those results appear to be valid. The following
> is a simple example:
> typedef union _myUnionType {
>    union {
>        int a;
>    };
> } myUnionType;
> void func() {
>    myUnionType var;
>    var.
> }
> 'var.' is returning a single completion result having a
> CXCursor_NotImplemented cursor kind.
> Does anybody know if there's any risk in using CXCursor_NotImplemented
> completion results?


There is no risk at all. The cursor associated with a completion result is simply to help with the UI for code completion if, e.g., one wants to use a different icon for variables vs. functions.

        - Doug
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: clang_codeCompleteAt returning invalid completion results

jaytee
Hello again! and thank you for your reply, Doug!
So this basically means that CXCursor_NotImplemented completion results are fine to use, but I cannot distinguish between the types of these results (e.g. field vs enum)?

Do you know perhaps if I will get something similar to this for other types of cursors (e.g. variables),  or does this only happen for struct/union fields?

Thank you!
Reply | Threaded
Open this post in threaded view
|

Re: clang_codeCompleteAt returning invalid completion results

Douglas Gregor

On Feb 20, 2013, at 10:31 AM, jaytee <[hidden email]> wrote:

> Hello again! and thank you for your reply, Doug!
> So this basically means that CXCursor_NotImplemented completion results are
> fine to use, but I cannot distinguish between the types of these results
> (e.g. field vs enum)?

Correct.

> Do you know perhaps if I will get something similar to this for other types
> of cursors (e.g. variables),  or does this only happen for struct/union
> fields?


I have no idea. Clang 2.9 is three major releases and nearly two years old, so I don't recall what bugs it had in this area. I'd expect modern Clang's to provide cursor kinds for most completions.

        - Doug
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev