Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support C "if" statements (hints for big if statements) #4

Closed
mumpitzstuff opened this issue Jan 9, 2012 · 6 comments
Closed

Support C "if" statements (hints for big if statements) #4

mumpitzstuff opened this issue Jan 9, 2012 · 6 comments
Assignees
Milestone

Comments

@mumpitzstuff
Copy link

Hints should always be visible independant of the size of the statement. If the statement is too big, strip the statement to something like "// if (...)", because sometimes it is useful to know if the bracket matches an if or for if they are e.g. nested.

@chookapp
Copy link
Owner

chookapp commented Jan 9, 2012

You can configure Bracketeer to always show you the hints (in the preferences: Bracketeer->Hints. See the "Min lines between brackets". Configuring it to 0 will cause the hints to always be shown).

Also, you can configure (in the same preferences page), the length of a hint and how to "strip" it (See "Max length").

In the next version of Bracketeer you would also be able to see the hint when hovering over a closing bracket.

@chookapp chookapp closed this as completed Jan 9, 2012
@mumpitzstuff
Copy link
Author

The problem is that i do not see hints with the configuration above for if statements (min lines = 0, max length = 100) in default and if (only to be sure)). The size of the if statements seems to do not matter. Maybe therefore i do not see any hint for else...

if (test >= 2)
{
testtest = (unsigned long)testtesttest;
}

hints are working for defines and loops like for and switch.

@chookapp
Copy link
Owner

this is very strange, I just checked this, and got the hints, as expected (the comments are hints, I didn't write them in the code):

if( prio1 == 1)
{
} /* if(prio1==1) /
else
{
} /
else_of_if(prio1==1) */

Please note 2 things:

  1. If something is written after the closing "}", a hint would not be shown.
  2. Sometimes CDT has problems parsing some files, and so I can't get the AST information. Does this error happened to you in all your files?

Hope this helps.

@mumpitzstuff
Copy link
Author

Hmm very strange. I checked some places (different files) in our code now and there are absolutly no hints for if and else. I only see them for loops like e.g. for or defines. I have the same issue on another computer in a different project. There is always nothing written after the closing bracket. We use the following versions:

Eclipse C/C++ Development Tools
Version: 8.0.0.201109151620

Eclipse Platform
Version: 3.7.1
Build id: M20110909-1335

PS: I see no hints for your code example too (comments are removed). I created a new empty project with your code example...

@chookapp chookapp reopened this Jan 12, 2012
@chookapp
Copy link
Owner

I think I found the problem.
CDT distinguishes between C++ "if" and C "if" (for some odd reason), I currently support only the C++ version.
Will be fixed in upcoming version.

@ghost ghost assigned chookapp Jan 12, 2012
@mumpitzstuff
Copy link
Author

Ah okay. We always use C projects for embedded systems. Thank you very much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants