Page 1 of 2

Code completion - Ansi C

Posted: Tue Apr 08, 2014 12:57 am
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)

Re: Code completion - Ansi C

Posted: Tue Apr 08, 2014 12:04 pm
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

Re: Code completion - Ansi C

Posted: Wed Apr 09, 2014 1:19 am
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.

Re: Code completion - Ansi C

Posted: Wed Apr 09, 2014 11:39 am
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

Re: Code completion - Ansi C

Posted: Thu Apr 10, 2014 10:25 am
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

Re: Code completion - Ansi C

Posted: Thu Apr 10, 2014 10:37 pm
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

Re: Code completion - Ansi C

Posted: Fri Apr 11, 2014 11:38 am
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.

Re: Code completion - Ansi C

Posted: Fri Apr 11, 2014 11:54 am
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

Re: Code completion - Ansi C

Posted: Fri Apr 11, 2014 1:02 pm
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.

Re: Code completion - Ansi C

Posted: Fri May 23, 2014 10:24 pm
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.