Code completion - Ansi C

General questions regarding the usage of CodeLite
toninlg
CodeLite Curious
Posts: 7
Joined: Mon Apr 07, 2014 10:41 pm
Genuine User: Yes
IDE Question: C++
Contact:

Code completion - Ansi C

Post by toninlg »

Hi,

What can I expect for code completion for Ansi C? I had some completion for arguments of functions, but not for functions. Ie : if I type "print", code completion displays private and protected but not printf (stdio is included) or the function of my library which starts with print too.

Thanks.

(codelite binary 5.4 / Win7)
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Code completion - Ansi C

Post by eranif »

codelite's code completion is "on-demand" by default, i.e. you need to request code completion.
Did you try enter Ctrl-SPACE?

You can also set code completion to auto-show after typing X characters from: Settings -> Tags Settings -> triggering

Eran
Make sure you have read the HOW TO POST thread
toninlg
CodeLite Curious
Posts: 7
Joined: Mon Apr 07, 2014 10:41 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Code completion - Ansi C

Post by toninlg »

Thanks, it's working. The language keyword completion window was "overidding" the code completion so I had to disable the keyword completion to see code completion.

Are the Doxygen comments displayed by default in the code completion box or do I have to activate something? I have tried to enable Clang only since I suppose this is this compiler that parse the comments but no comments are displayed.
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Code completion - Ansi C

Post by eranif »

toninlg wrote:Are the Doxygen comments displayed by default in the code completion box
Yes
toninlg wrote:I have tried to enable Clang only since I suppose this is this compiler that parse the comments but no comments are displayed.
No need for this

Can you provide an example of code that has doxygen comments and it does not show it?

Eran
Make sure you have read the HOW TO POST thread
toninlg
CodeLite Curious
Posts: 7
Joined: Mon Apr 07, 2014 10:41 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Code completion - Ansi C

Post by toninlg »

Here is two examples.
First one for an after member comment:
cap-1.jpg
Second one for a function's comment :
cap-2.jpg
You do not have the required permissions to view the files attached to this post.
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Code completion - Ansi C

Post by eranif »

The parser knows to associate comments to variables/function only if it is placed _directly_ above the function without any extra new lines
If you can move the doxy comments a bit down - it will be shown

Please open bug report for this (to ignore any whitespace between the comment and the function/variable)

Thanks,
Eran
Make sure you have read the HOW TO POST thread
toninlg
CodeLite Curious
Posts: 7
Joined: Mon Apr 07, 2014 10:41 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Code completion - Ansi C

Post by toninlg »

Hi,

It's partially working. The parser recognizes the \brief Doxygen command but not the others :
cap2a.jpg
but if I use the "extended" commenting style, the parser sees only the last -------- :
cap2b.jpg
Thanks.
You do not have the required permissions to view the files attached to this post.
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Code completion - Ansi C

Post by eranif »

toninlg wrote:The parser recognizes the \brief Doxygen command but not the others
The parser udnerstands more than brief, but not the ones you set (please open a bug for this)
toninlg wrote:but if I use the "extended" commenting style, the parser sees only the last -------- :
Well, there are actually _2_ different set of comments here (even thuogh it looks like 1)
So codelite associates the last comment which is

Code: Select all

/*-----*/
with the function

Eran
Make sure you have read the HOW TO POST thread
toninlg
CodeLite Curious
Posts: 7
Joined: Mon Apr 07, 2014 10:41 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Code completion - Ansi C

Post by toninlg »

I thought it was that. I will change the comments style for my code.

Does the parser implements the comments of variables?
ie :

Code: Select all

int var; /*!< Detailed description after the member */
int var; /**< \brief Detailed description after the member */
I'll open the bugs for the space and the other Doxygen commands.
toninlg
CodeLite Curious
Posts: 7
Joined: Mon Apr 07, 2014 10:41 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Code completion - Ansi C

Post by toninlg »

Hi,

Would you please reconsider the issue https://github.com/eranif/codelite/issues/452 ? I've added a comment to the issue to better explain the problem.

Thank you.
Post Reply