Automatic Closing Brace?

Something has changed or is broken. PHPStorm used to add the closing brace when I pressed space or enter, but no longer does that - did I disable it somehow? I can't find a setting for that.

2

Hi there,

The option is located at "Settings/Preferences | Editor | General | Smart Keys --> Enter | Insert pair '}'"

But you better check where (what kind of code) it cannot insert the closing brace. Check it in another/new file; in brand new project.

What IDE version do you use when it does not work? There were some reports that it stopped doing that in 2017.1 EAP (in some places) -- e.g. https://youtrack.jetbrains.com/issue/WI-34758 , https://youtrack.jetbrains.com/issue/WI-34579#comment=27-1837783

 

3

Ok, that setting is enabled. Actually, now that I test it more, it is working when I just add it with no code to wrap, but I rarely do that (I tend to write my code very out of order, and the place that it used to work where I use it most is if if I put an opening { just before "echo" in this code, then pressed enter, it used to wrap the line, but that's what is not working.

if(1)
echo "";

PhpStorm 2017.1 EAP
Build #PS-171.2613.13, built on January 25, 2017
PhpStorm EAP User
Expiration date: February 24, 2017
JRE: 1.8.0_112-release-b696 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o

1

Seems to work here on my PC (in both 2016.3.2 and 2017.1 EAP 171.2613.13)

No idea what it might be in your case.

0

Yea, that never works and I had a least one example where it did not work for this earlier today:

 

class testclass{

function test(){<<<<<<NO CLOSING BRACE HERE


}
1

Could you please record a video/gif of an issue? we can't reproduce the same with an example provided.

0

There is a couple of similar issues, I believe it's this one:
https://youtrack.jetbrains.com/issue/WI-34673
However, you might want to vote for the other too:
https://youtrack.jetbrains.com/issue/WI-34733

0
Avatar
Permanently deleted user

Thank you very much!

0

请先登录再写评论。