Extra bracket for both functions and statements

When adding line inside existing bracket, AppCode always add an unnecessary bracket.

This is unprecedented behaviour before AppCode 2016.1.

 

For example:

Adding another line inside bracket always result in;

 

I'm using Vim Emulator. Disabling Vim Emulator gives me the same result anyway.

1
7 comments
Avatar
Tatiana Shabaeva

Hi,

Unfortunately, I can't replicate the problem.

Could you please report an issue in the tracker and attach your code style settings (exported via File -> Export Settings). Do you see the problem on all projects of yours or on a specific one?

0

Now I find that this problem is in the very specific .c file.

The other .c files in the same project are OK.

Can exported setting help solving this problem?

0
Avatar
Tatiana Shabaeva

In this case, I believe, no. It would be much better if you share the problematic file with us (appcode-support at jetbrains.com) if that's possible. Otherwise, you may try to narrow down the problem to a shortened code snippet. Also it would be useful to check if there are no parser errors in that specific file.

0

I've found the cause of the problem is a function whose arguments are changeable by define condition.

No parser error present but any bracket auto-completion is devastated.

Below is a pseudo snippet code;

#ifdef _USE_CONTEXT_
int somefunc(int num, Context *ctx) {
#else
int somefunc(int num) {
#endif
int ret;
... do something
#ifdef _USE_CONTEXT_
... do something to ctx
#endif
return ret;
}
0

I've tried to reproduce the issue, but it correctly works in my environment. Could you please create the issue in the tracker and attach a screencast there?

0

I've filed an issue.

 https://youtrack.jetbrains.com/issue/OC-13666 

You can find an example project of mine.

0

OC-13666 has been marked duplicated.

It's parent issue is https://youtrack.jetbrains.com/issue/CPP-2879 and has been open since Nov/2011 and stays open still.

It seems it will never be fixed in the future.

0

Please sign in to leave a comment.